Featured

    Featured Posts

logger command

'', 'clear' => '', 'margin_top' => '', 'margin_bottom' => '', 'padding_top' => '', 'padding_bottom' => ''), array(), array()) -->

To manually create a log entry, you can use the logger command. This command serves as an interface to the syslog system log module and it is commonly used in scripts. For example, a backup script might use logger to record details such as its start and stop times and the number of files it has backed up.

Here is a simple example:

NOTE – by default, logger writes to /var/log/messages.

To record the process ID (PID) of the logger process along with other data, use the -i option:

linux logger log pid

To log the content of a file, use the -f option:

linux logger log file content

By default, logger includes its name in the log file as the tag. To change the tag, use the -t TAG option:

linux logger custom tag

To echo the message to standard error (the screen), as well as to /var/log/messages, use the -s option:

linux logger standard error

'', 'clear' => '', 'margin_top' => '', 'margin_bottom' => '', 'padding_top' => '', 'padding_bottom' => ''), array(), array()) -->logger command example

author

Author Name

Author Description!

Get Free Email Updates to your Inbox!

Post a Comment

www.ccna.ma

yu
Powered by Blogger.

Translate

Copyright © Learn Linux Th3pro.xyz | Blogger Templates | Designed By Code TAOUSSI