Log4bash: Logging for Linux Shell

Apr 28, 2009

With version 1.0, log4bash makes its first appearance in providing logging functions for shell scripts.

With version 1.0, log4bash makes its first appearance in providing logging functions for shell scripts.

The open source project is itself a bash script tailored for the GNU project shell. Developer Philip Paterson recommends the log4sh logging framework for users of other UNIX shells.

Log4bash uses the log4j Java framework as model and allows creation of easy to read and parse log files from bash scripts. It provides six log levels from FATAL to DEBUG and can display logging output to the screen along with log files. The documentation includes a working sample script.

Log4bash is under LGPL 2.1 and available for download from the project page.

Related content

  • Bash vs. Vista PowerShell

    Microsoft’s new PowerShell relies on .NET framework libraries and thus has access to a treasure trove of functions and objects. How does PowerShell measure up to traditional shells like Bash?

  • Bash Completion 1.1 Adds Shell Functionality

    The Bash shell has long supported extending command completion through scripts. The Bash-Completion package delivers full scripts for Linux commands and is currently available in version 1.1.

  • Command Line

    A few basic tricks can liven up the command line and add a dash of color to your console.

  • Bash 4

    Despite the Bourne-again shell's biblical age and high level of maturity, developers continue to work on it. We take a look at the latest Bash release.

  • SHC: Bash Script Compiler

    The Bash Shell Script Compiler converts shell scripts directly into binaries. Compiling your scripts provides protection against accidental changes, but you will have to contend with some quirks.

comments powered by Disqus

News