Regirect /var/log/log/syslog messages to our own txt file

Daniel Baluta daniel.baluta at gmail.com
Sat Sep 19 14:52:55 EDT 2015


On Sat, Sep 19, 2015 at 9:29 PM, Gunjan Mehta <gunjanmehta08 at gmail.com> wrote:
> Hi,
>
> I am working on a project, where i print my log messages in
> /var/log/log/syslog like
>
> project_my:info::project started
> project_my:debug::value of a is 1
>
> i want to redirect project_my:info messages in info.txt file and
> project_my:debug  in debug.txt file.

Hi Gunjan,

If I'm not wrong this depends on your syslog daemon.

For example using rsyslog, you have an /etc/rsyslog.conf file
useful for configuring rsyslog.

If you are talking about kernel messages than adding:

kern.debug                         -/your/debug/file.txt
kern.info                               -/your/info/file.txt

HTH,
Daniel.



More information about the Kernelnewbies mailing list