Dave's Brain

Browse - Programming Tips - How can I write a message to /var/log/messages ... the syslog?

Date: 2013sep20
OS: Linux
Language: Bash

Q.  How can I write a message to /var/log/messages ... the syslog?

A.  Use the logger command.  Eg:

logger "Hello world"
See its man page for options Very handy for script that run in the background (or cron)

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.