University Crest

[wlug] logger

wlug archive index About the wlug list Mailing lists home
To The University of Waikato HomepageWaikato Home > Waikato Mailing Lists > wlug Info > wlug archives
Oliver Jones oliver@d...
Tue Apr 19 18:17:45 NZST 2005

Logger is indeed a useful command line tool for shell scripts that want
to log messages to syslog.  

If you're writing Perl scripts you have a little more in the way of

You can use the CPAN module Sys::Syslog for basic syslog access. Or you
can use Log::Dispatch which can use Syslog, amongst other things such as
Email, files etc.

You can also use Log::log4perl which is a Perl version of Log4J.   Log4J
is a very flexible application logging framework.

If you're a PHP coder you can use log4php.  In fact on there are links to ports for PHP, C/C++, .Net/Mono,
Perl, PLSQL, and Java.  Most Log4J ports support some sort of Syslog
logging interface.

Deciding on a good Logging framework early on in your applications
development, no matter what language you use, can be a very good thing.
Logging can aid tremendously in debugging and understanding what your
daemons/applications are doing.

A good thing about the Log4* framework is that you can leave your
logging statements in your code and control the verbosity very finely
with config files (XML or "property" style files).


On Tue, 2005-04-19 at 17:32 +1200, James Clark wrote:
> This isn't new to me, but maybe someone might think "hey that's just
> what I wanted", since it's a slow day on yon list.
> If your running an application and want to capture the output to a system
> log file, you can use logger.
> Instead of explain it in too much depth, try the below while tail -f'ing
> /var/log/daemon.log. 
>   echo test | logger -p -t \[test\]
> You'll now have an idea of what it does and why you might like to use it,
> of course you can do more so you can always rtfm @ `man logger`.
> Cheers,
> James.
> _______________________________________________
> wlug mailing list | wlug@l...
> Unsubscribe:
                   Oliver Jones » Roving Code Warrior
   oliver@d... » +64 (21) 41 2238 » 

More information about the wlug mailing list
NOTICE: This is an archive of a public mailing list. The University of Waikato is not responsible for its contents.

The University of Waikato - Te Whare Wananga o Waikato