Can console.app parse log files?
The Console app displays the system.log file differently from other files ending in .log - it can display different columns with Time, sender, Message, host, etc. Additionally you can search for specific messages.
Here is my question:
Is is possible to display other log files like this? Maybe it's possible to create a "pattern file" that teaches Console how to display my files nicely? I am a web programmer and would like to read the custom log files from my applications in Console in a nicely formatted way.
I don't think the Console application will do what you want. The view that you describe is coming out of a database (/var/log/asl.db); it's not being displayed by directly parsing the text files.
Now, you can add to this asl.db database by utilizing syslogd (see "man asl.conf" and "man syslogd" for more information), which could in theory control what you see in Console. However, that's not going to be as clean or as easy as I think you'd like.
Hope this helps a little...
Similar Messages
-
Console app: not logging "all messages" or "console messages". HELP
I had a system freeze. After forced shutdown, repairing permissions, repairing disk, cleaning caches etc.
All running BUT:
In the console app under "LOG DATABASE QUERIES" the entries all messages and console message are no longer showing entries!!!
The last ones are up until the crash.
I don't know what else to do.
HELPyou can follow the instructions given on MacFixit:
http://www.macfixit.com/article.php?story=20090122213555897
just deleting the asl files within the /var/log/asl directory may be enough to fix the problem; the asl manager will be forced to reinitialize the logs writing that appear in the log database database queries on the console. -
Why can't read access log file in real-time? (Oracle Weblogic Server 10.3)
We can't read access log file in real-time. If access log is rotation to new file so can read access log file but can't read real-time.
*** Oracle Weblogic Server versions 10 R3what's your meaning? try this command "tail -f access.log".
Threre is a buffer about 8K for WebLogic to write the access info into the log files, so you can't see the access info untill the buffer is full. -
Where can I find the LOG file for bash/command history typed into Terminal?
Where can I find the LOG file for bash/command history typed into Terminal?
For 2 weeks ago I was searching for a log file on my server. Somehow I opend a file where I could see a list of all bash-commands I had ever entered into OSX Terminal.
Now I need this file.. but cant find it.
What is the official location for this LOG file?
Thank you so much for helping.cat .bash_history
-
Rman can not able generate log file in linux shell script
Friends,
In shell script we use below command to save processing information.
$ORACLE_HOME/bin/rman "target=/" > ${LOG} <<- EOF
Recent days, it does not work and return message as
./test.sh: line 78: LOG: command not found
./test.sh: line 83: /u01/test/oracle/scripts/crons/logs/testdb_013120141148.log: No such file or directory
find: /u01/test/oracle/scripts/crons/logs: No such file or directory
It seems that rman can not create a log file when we passed log variable value.
Thanks for helpHi,
Seems some one removed the log directory.. check the log directory as specified in the script. and create that one if not exist. -
WD app Deployment Error - Where can we find J2ee log file for linux install
Hi,
I have a problem with deploying a web dynpro application. There are no errors before deployment but when I deploy the application, I get a deployment error with the following description.
I tried to view the trace or log file but we have SAP installed on a linux OS and I do not know where can we see the log or trace file. Please help.
Version:
SAP NW 2004s SP15
NWDS 7.0
xRPM 4.5
Error Description:
May 14, 2008 12:49:50 AM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager)
[Thread[Deploy Thread,5,main]] ERROR:
[008]Deployment aborted
Settings
SDM host : BS307
SDM port : 50718
URL to deploy : file:/C:/DOCUME1/SMULLA1/LOCALS~1/Temp/2/temp20045SempraDemo4.5.ear
Result
=> deployment aborted : file:/C:/DOCUME1/SMULLA1/LOCALS~1/Temp/2/temp20045SempraDemo4.5.ear
Aborted: development component 'SempraDemo4.5'/'local'/'LOKAL'/'0.2008.05.14.00.49.36'/'0':Caught exception during application deployment from SAP J2EE Engine's deploy service:java.rmi.RemoteException: Cannot deploy application local/SempraDemo4.5.. Reason: Clusterwide exception: Failed to deploy application local/SempraDemo4.5. Check causing exception for details (trace file). Hint: Are all referenced components deployed and available on the engine?; nested exception is: com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to deploy application local/SempraDemo4.5. Check causing exception for details (trace file). Hint: Are all referenced components deployed and available on the engine? (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)
Deployment exception : The deployment of at least one item aborted
Edited by: Subramanya Srinivas Mullapudi on May 14, 2008 8:34 AMHi Reza,
Hope you are doing good.
You can set the trace level in the SAP/Java Gui dynamically :
Call transaction SMICM
Choose the menu Goto → Trace Level → Set
In the pop-up window, set the desired level (0,1,2,3)
To switch on an /nSMICM or ICM HTTP trace via command line you should go to
usr\sap\<SID>\<instance_number>\exe directory and run the icmon program with the following command:
icmon◦◦pf=\usr\sap\<SID>\SYS\profile\<SID>_<instance_name>_<HOST>
where you fill in the SID, instance name and host corresponding to your system.
The icmon program is interactive and to increase trace level you must write
"+" and pres enter.To quit you must write "q" and press enter.
The trace will be written◦to the following file: usr\sap\<SID>\<instance_number>\work\dev_icm
Thank you!
Kind Regards,
Hemanth
SAP AGS -
How can I save my Log files (and other my own files) to windows azure ?
Hi ,Dear all
I am migrating an Asp.Net Web App to Windows Azure. It runs in IIS
In that Web App,it will:
1. save log files to a virtual path (for example, save to $WEBAPP_ROOT_DIR/LOGFILES/
2. save ViewState by session as temporary files to a virtual path (for example , save to $WEBAPP_ROOT_DIR/VIEWSTATE/
3. upload some image files to the web server virtual path at $WEBAPP_ROOT_DIR/UPLOAD/
so, when I migrate the web app to windows azure,how can I do the same job in my code?It seems so many great changes in my code ...
Any ideas and suggestions for me ? many thanks!hi Eric,
If you use Azure website, you can save your log and files into azure storage service ,such as blob or table.
If you use VM to host your service, you can only attach a data disk or file service on your VM and save your data into data disk or file service.
Regards,
Will
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Job console messages in log file
Hi All,
Is there a log file which logs the job console messages...where is it located ...we are on V11.1.2.,,....We have a issue with Job console validation......when a EPMA planning application is validated...it has some errors....but when we try to open the attachment to get more details...a new window opens and closes immediatly...
how can we check the error messages?In IE try going to Internet Options > Security > Custom Level > Downloads > File Downloads > enable
This should allow the text file to open when you try to open the attachment.
Cheers
John
http://john-goodwin.blogspot.com/ -
Parse log file using powershell
Hi,
Am pretty new to Powershell and would require anyone of your assistance in setting up a script which parse thru a log file and provide me output for my requirements below.
I would like to parse the Main log file for Barra Aegis application(shown below) using powershell.
Main log = C:\BARRALIN\barralin.log
Model specific log = C:\BARRALIN\log\WG*.log
Requirements :
1. scroll to the bottom of the log file and look for name called "GL Daily" and see the latest date which in the example log below is "20150203"
note : Name "GL Daily" and date keep changing in log file
2. Once entry is found i would like to have a check to see all 3 entries PREPROCESS, TRANSFER, POSTPROCESS are sucess.
3. If all 3 are success i would like to the script to identify the respective Model specific log number and print it out.
E.g if you see the sample log below for "GL Daily", it is preceded by number "1718" hence script should append the model log path with "WG00" along with 1718, finally it should look something like this C:\BARRALIN\log\WG001718.log.
4. If all 3 items or anyone of them are in "failed" state then print the same log file info with WG001718.log
Any help on this would be much appreciated.
Thank You.
Main log file :
START BARRALINK Check Auto Update 1716
43006 20150203
Trgt/Arch c:\barralin
PREPROCESS success 0 preprocessor: no error
TRANSFER success 1 Host success: files received
POSTPROCESS success 0 Postprocessor: no error
CONFIRMATION success 2 No Confirm needed
STOP 43105 20150203
START Aegis GL Monthly
1716 43117 20150203
Trgt/Arch K:\barraeqr\aegis\qnt\gleqty
PREPROCESS success 0 preprocessor: no error
TRANSFER success 1 Host success: files received
POSTPROCESS success 0 Postprocessor: no error
CONFIRMATION success 2 No Confirm needed
STOP 44435 20150203
START Aegis UB Daily
1717 43107 20150203
Trgt/Arch K:\barraeqr\aegis\qnt\gleqty
PREPROCESS success 0 preprocessor: no error
TRANSFER success 1 Host success: files received
POSTPROCESS success 0 Postprocessor: no error
CONFIRMATION success 2 No Confirm needed
STOP 44435 20150203
START Aegis GL Daily
1718 44437 20150203
Trgt/Arch K:\barraeqr\aegis\qnt\gleqty
PREPROCESS success 0 preprocessor: no error
TRANSFER success 1 Host success: files received
POSTPROCESS success 0 Postprocessor: no error
CONFIRMATION success 2 No Confirm needed
STOP 50309 20150203
Hi All,
I was writing a function in power shell to send email and i was looking to attach lines as and when required to the body of the email. but am not able to get this done..Here's my code
Function Email ()
$MailMessage = New-Object System.Net.Mail.MailMessage
$SMTPClient = New-Object System.Net.Mail.SmtpClient -ArgumentList "mailhost.xxx.com"
$Recipient = "[email protected]"
If ($MessageBody -ne $null)
$MessageBody = "The details of Barra $strsessionProduct model is listed below
`rHostName : $localhost
`r Model Run Date : $Date
`r Model Data Date : $DateList1
`r`n Click for full job log"+ "\\"+$localhost+"\E$\Local\Scripts\Logs "
$MailMessage.Body = $MessageBody
If ($Subject -ne $null) {
$MailMessage.Subject = $Subject
$Sender = "[email protected]"
$MailMessage.Sender = $Sender
$MailMessage.From = $Sender
$MailMessage.to.Add($Recipient)
If ($AttachmentFile -ne $null) { $MailMessage.Attachments.add($AttachmentFile)}
$SMTPClient.Send($MailMessage)
$Subject = "Hello"
$AttachmentFile = ".\barralin.log"
$MessageBody = "Add this line to Body of email along with existing"
Email -Recipient "" -Subject $Subject -MessageBody $MessageBody -AttachmentFile $AttachmentFile
as you can see before calling Email function i did add some lines to $MessageBody and was expecting that it would print the lines for $MessageBody in Email Function along with the new line. But thats not the case.
I have tried to make $MessageBody as an Array and then add contents to array
$MessageBody += "Add this line to Body of email along with existing"
$MessageBody = $MessageBody | out-string
Even this didnt work for me. Please suggest me any other means to get this done.
THank You -
Incosistencies between Analyzer Server Console and stout.log file
Hi,<BR><BR>In stout.log file of application server file there is a record:<BR>"Setting Current User Count To: 2 Users. Maximum Concurrent Licensed User Count Is: 10 Users." So 2 licences are ured, but checking "Analyer Server Console" there is only one user connected.<BR><BR>After restarting computer "Analyzer Server Console" and stout.log number of users are sinhronized. But I don't know what happens, but after some time this two parameters are not sinhronized anymore.<BR><BR>My problem: I have to show the number of user licences used and I am reading info rom stout.log. But something is not correct - it looks like stout.log doesn't show correct values?<BR><BR>Do I need to specify some setting or is there a bug in code?<BR><BR><BR>My system:<BR>Hyperion Analytic Server version 7.1.0<BR>Hyperion Analyzer Server version 7.0.1.8.01830<BR>IBM DB2 Workgroup Edition version 8 fixpack 9<BR>Tomcat version 4<BR>Windows 2003 Server
Hi grofaty.<BR><BR>We use 7.0.0.0.01472 and I had experienced the same behaviour, <BR>Analyzer Server Console shows one more session than stdout.log.<BR><BR>If this difference 1 is a static value than you can assume it as an systematic bug...and do your license counting on it...<BR><BR>But again the Analyzer Server Console is not good as it should be for productive usage because all the information is only logged online til the next application restart. E.g. it is not helpful in using it for user tracking purposes. Do you use the stdout.log in such a way or have an idea how to grep measures for session logging analysis:<BR> - Session ID <BR> - User ID<BR> - Client ID <BR> - Total Number of Requests <BR> - Average Response (sec) <BR> - Login Time<BR> - Number of concurrent sessions<BR><BR>?
-
How can I change the log file path instead of storing log in server.log
Hi,
I have created one domain and modified the attribute "log-file" in element "virtual-server" element to point to the new log file path.
But when I start up my domain, it still saying: "Log redirected to DOMAIN_LOCATION/logs/server.log.
Why?
Why it doesn't log to the file I specify? How can I change it?
Thanks.
KenI have changed the logging option to my specific path in admin console as what you said. I have also changed the logging in domains attribute too.
But still there is some logging info in domains/<dom_name>/logs/server.log instead of the path and file I specified.
Is it possbily related to linux user role setting? the Sunone AS is installed and configured by root user. But the domain is created for another user, hence I want to forward all logging info to that user's home path. -
Getting script to write output to console and a log file
Hello everyone. I'm working on a script that will search through a bunch of folders, pull anything larger than 50Kb out and then write a log file of what it moved. What I have so far is what I've pieced together through my research. It works, but it doesn't
write anything to the console which I believe is why my log isn't showing any info.
Here's the code:
get-ChildItem -path $path -recurse -ErrorAction "SilentlyContinue" -include $Extension | ? {$_.GetType().Name -eq "FileInfo" } | where-Object {$_.Length -gt $size} | Copy-Item -Destination c:\test|results_big | Out=File c:\test\log.txt
What I've been trying to do is add a | write-host in there somewhere, but all I get is countless red text with a variety of messages reminding me of my ignorance :). Thoughts?Hi Scotty,
here's an edit:
Get-ChildItem -path $path -recurse -ErrorAction "SilentlyContinue" -include $Extension | Where-Object { (-not $_.PSIsContainer) -and ($_.Length -gt $size)} | Copy-Item -Destination "c:\test_results_big" -PassThru | Out-File "c:\test\log.txt"
Soo, what did I change?
- Replaced checking for item type I checked the PSIsContainer property (which is true for folders)
- Combined the two Where-Object calls into a single one
- Fixed the path for copy-item destination
- Added the -PassThru parameter - otherwise Copy-Item won't give output causing you to export nothing to file.
- Fixed a typo - Out=File --> Out-File
Cheers,
Fred
There's no place like 127.0.0.1 -
Parsing Log file with PowerShell
Hey Guys, I have the following line in a txt file (log file)
2012-08-14 18:00:00 [ERROR] . Exception SQL error 1 2012-08-14 18:10:00 [ERROR] . Exception SQL error 22012-08-15 18:00:00 [INFO] . Started
- Check the most recent entry(s) the last 24 hours
- if there's an error [ERROR] write-out a statement that says (Critical) with the date-time of the error
- If there's no erros write-out (Ok)
So far I learned to write this much and would like to learn more from you:
$file = "C:\Users\example\Documents\Log.txt" cat $file | Select-String "ERROR" -SimpleMatchHello,
I am new to PowerShell, and looking for same requirement, here is my function.
Function CheckLogs()
param ([string] $logfile)
if(!$logfile) {write-host "Usage: ""<Log file path>"""; exit}
cat $logfile | Select-String "ERROR" -SimpleMatch | select -expand line |
foreach {
$_ -match '(.+)\s\[(ERROR)\]\s(.+)'| Out-Null
new-object psobject -Property @{Timestamp = [datetime]$matches[1];Error = $matches[2]} |
where {$_.timestamp -gt (get-date).AddDays(-1)}
$error_time = [datetime]($matches[1])
if ($error_time -gt (Get-Date).AddDays(-1) )
write-output "CRITICAL: There is an error in the log file $logfile around
$($error_time.ToShortTimeString())"; exit(2)
write-output "OK: There was no errors in the past 24 hours."
CheckLogs "C:\Log.txt" #Function Call
Content of my log file is as follows
[ERROR] 2013-12-23 19:46:32
[ERROR] 2013-12-24 19:46:35
[ERROR] 2013-12-24 19:48:56
[ERROR] 2013-12-24 20:13:07
After executing above script, getting the below error, can you please correct me.
$error_time = [datetime]($matches[1])
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\PS\LogTest.ps1:10 char:21
+ new-object psobject -Property @{Timestamp =
[datetime]$match ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Cannot index into a null array.
At C:\Test\LogTest.ps1:12 char:21
+ $error_time = [datetime]($matches[1])
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray -
Can I monitor a Log file using EMGC 10.2.0.2?
Hi,
I am thinking of monitoring my web application log file using EMGC by creating a generic service is that possible. Now we are using some shell scripts to do that but its bit difficult to maintain all these shell scripts on each of the host. Is there any in built in mechanism that enable me to monitor the log file and when a perticular pattern match I would like to send a email notification to concerned people say application admins if there is no out of box option for this do we have plugins to do this. please let me know the possibility of implementing this using EMGC or extencibility plug-ins.
Ashok Chava.Hi,
I have used "Log File Pattern Matched Line Count" of host to monitor the log files and below is the pattern I have defined for the log file. But i could not find any alerts even there are so many such exceptions in the log file matching the patteren given in EMGC.
/u01/app/oracle/product/IAS904/sysman/log/emias.log;%oracle.sysman.emSDK.util.jdk.EMException;%
I have even add the log file in agent_home/sysman/config/lfm_ifiles file as given in the documentation but I could not see any alerts as expected am I doint anything wrong in my setup.
Please let me know.
Thanks,
Ashok Chava -
How can we delete archive log files from OEM
Hi,
I took backup of the archive log file and deleted it at OS level but in it is not reflecting in the EM can any one tell me how to delete archive log files from OEM.
any help will be appreciated.
Regards,
AshrafThis link?
http://download-west.oracle.com/docs/cd/B10501_01/em.920/a96670/ch_backp.htm#26936
Maybe you are looking for
-
I can no longer add a scanned document to a pages document since the recent pages upsoftware update . Any ideas on how to resolve this ?
-
Does SCSM 2012 R2 supports reporting in fim 2010 r2?
Hi Everyone, I have a scenario where i am configure fim reporting with SCSM and i have the fim version of 2010 r2 and scsm 2012 r2 ?It would be great if u provide me the information I have ran the powershell script on on datawarehouse successfully I
-
i just wanted to know some names of some viruses which infect n-series. and what effect they have on ur phone. At last a nseries phone im truely happy with THE N82
-
Macbook Pro won't power on, what should my game plan be?
Hello, So I have a 17" 2.53 ghz i5 500gb MBP from Mid 2010 running snow leopard (can't remember which os). I have never really had issues with it other than a busted cd-drive. Around October, I plugged my old iphone 4 into the usb port and my compute
-
How do I open library file from another application?
I'm trying to upload a picture from my IPhoto library to the internet. When the internet program asks me to name a file, I browse my "Pictures" folder. And I see the iphoto library there, but it is not available to select. I need to be able to select