six demon bag

Wind, fire, all that kind of thing!

2020-02-24

Shell Patterns (1) - Logging

This is a short series describing some Bash constructs that I frequently use in my scripts.

What do you do when you run fully automated scripts in the background, but still want to keep track of what they're doing and, more importantly, when something goes wrong? The answer is, of course, you log what the script is doing (or is about to do).

There are two commonly used ways of implementing logging in Bash scripts:

Personally, I prefer the latter, since it allows not only for managing log files independently of the process creating the log output, but also for filtering log data and/or forwarding it to a central loghost.

See more ...

Posted 20:47 [permalink]

2011-03-13

A Logger Class for VBScript

I got tired of having to re-implement logging routines for my VBScripts on a regular basis, so I wrote a logger class that serves as an abstraction layer for logging to interactive console/desktop, files or eventlog. Now I just instantiate a new logger, define the logging facilities (default is console/desktop for interactive, eventlog for non-interactive execution), and can log away with the same set of methods, regardless of log target. See API documentation for details.

See more ...

Posted 22:10 [permalink]