What's new

How do I write to the log from shell script?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Neurophile

Occasional Visitor
Title says it all. I want to trap certain conditions in a shell script and make sure they show up in the log. Also, how do I set the "severity" of the log message so it gets stored/not stored correctly?
 
Code:
admin@Stargate88:/tmp/home/root# logger --help
BusyBox v1.20.2 (2016-06-03 14:34:02 EDT) multi-call binary.

Usage: logger [OPTIONS] [MESSAGE]

Write MESSAGE (or stdin) to syslog

    -s    Log to stderr as well as the system log
    -t TAG    Log using the specified tag (defaults to user name)
    -p PRIO    Priority (numeric or facility.level pair)
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top