LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Eventlog file (https://www.linuxquestions.org/questions/linux-newbie-8/eventlog-file-4175462057/)

Amit Kumar Gupta 05-15-2013 04:12 AM

Eventlog file
 
Please let me know how should we can genrate eventlog file for an application?

jdkaye 05-15-2013 04:17 AM

I'm not exactly sure what you're asking. If you have the appropriate permissions you can put it in /var/log or else in the user's home folder or anywhere else you like.
jdk

Amit Kumar Gupta 05-15-2013 04:32 AM

Hi jdk,

I dont have to do anything with application. Let say we had already done set-up in application and it is genrating a log file. But i want to generate a seperate eventlog file which takes records of only 'error' or 'warning' messages.

Thanks

Satyaveer Arya 05-15-2013 05:06 AM

Can you mention for which application you're askin about? Any particular application?

Amit Kumar Gupta 05-15-2013 05:09 AM

Arya g,
i have write a script which generated a evenlog file for an application. This is my over all task.

And the main problem i am new to Unix. I am trying to get help from this forum.

whizje 05-15-2013 05:15 AM

You can use incrontab for this.

Amit Kumar Gupta 05-15-2013 06:19 AM

Whizje,

i dont understand. Could you please clarify.

Thanks

chrism01 05-15-2013 07:24 AM

The qn isn't entirely clear, but you basically have 2 options

1. if you have access to the src, you can amend it to do what you want

2. if you don't have src access, you'll need to filter the output and grep the error msgs eg
Code:

tail -f file.log|grep 'error' >error.log
HTH

whizje 05-15-2013 09:08 AM

With incrontab you can monitor a file for changes and if there is a change run a script like the above to look if there is a error.

Habitual 05-15-2013 09:46 AM

There is NO need to install any "program" to monitor your script's error output. Because it won't work.
There is every need that you will have to code it in yourself, please see http://tldp.org/LDP/abs/html/ioredirintro.html for an introduction to "redirection".


All times are GMT -5. The time now is 02:16 AM.