Difference between revisions of "Logger"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 12: Line 12:
 
# Log messages to a different file using [[rsyslog]] and logger command<ref>http://jensd.be/372/linux/write-to-and-manage-syslog-messages-with-logger-and-rsyslog</ref>
 
# Log messages to a different file using [[rsyslog]] and logger command<ref>http://jensd.be/372/linux/write-to-and-manage-syslog-messages-with-logger-and-rsyslog</ref>
  
 +
 +
== Related commands ==
 +
* <code>[[systemd-cat]]</code>
  
  

Revision as of 10:54, 14 May 2020

Linux[1] (util-linux package) and most BSDs including MacOS provide logger command line utility to send messages to syslog, locally or to a remote syslog server. Many languages provide support for writing messages to syslog, such as go: https://godoc.org/github.com/spkg/slog.


Basic Usage

  • logger -s "Message"
-s, --stderr Output the message to standard error as well as to the system log.
  • echo "MY TEXT TO LOG" | logger -s
-s, --stderr Output the message to standard error as well as to the system log.

Activities

  1. Log messages to a different file using rsyslog and logger command[2]


Related commands


See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Original Source: https://en.wikiversity.org/wiki/Linux_Administration/System_Services/System_Logging/logger

Advertising: