|
/Admin/commandLine:
Logging to the System Log
This is actually more of a scripting thing, but what is a bash script except a collection of command lines....
To send a bit of text to /var/log/syslog:
logger Hello logging world!!
If you wish the output of a particular line in the script to be logged:
mysql -V | logger
will send the MySQL version to syslog. If you wish to also capture errors (STDERR) output, this will do it:
mysql < /path/to/a/sql/script.sql 2>&1 | logger
will send both script and error output to syslog.
posted at: 04:55 | path: /Admin/commandLine | permanent link to this entry