lwatch(1)

πŸ“¦
version 0.6.2 Β· 2 versions
, in ubuntu jammy

✨ NAME ✨

okay so bestie, this is the lwatch manual page β€” section 1 of the General Commands Manual, the girlies' favorite corner of the docs πŸ’… β€” and here's the whole vibe in one line:

lwatch β€” syntax highlighting for syslog/syslog-ng file

that's it. that's the girl. colorizing your logs, no cap.


🌈 SYNOPSIS 🌈

lwatch [-C filename]  [--config filename]  [-i filename]  [--input
filename]  [-o filename]  [--output filename]  [-sdOhv]  [--show-
unparsed]  [--daemon]  [--omit-rc]  [--help]

yes she's short. yes she's powerful. the way that a tiny synopsis is doing the absolute most 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

Lwatch is a log colorizer, periodt. It reads syslog/syslog-ng data from a named fifo or from stdin, and it displays colored logs into stdout. literally just ✨aesthetic logs✨.

Lwatch is highly user-customizable β€” she's giving main character who lets you pick her outfits. It reads configuration data from the file /etc/lwatch.conf or (if given) from the file provided with option -C.

The way it works is simple, fr fr. It reads a line from input (the built-in default is /var/lib/syslog.fifo), then splits it into four parts:

  • date
  • hostname
  • service name (with PID, if available)
  • real message

Each part has its own default color, and you can redefine them in the configuration file. Default colors are the same as in loco(1) [see: http://www.zjuul.net/~jules/loco/]. πŸŽ€

But lwatch is not only a static log colorizer β€” she's something more, and I'm obsessed. It can colorize your logs any way you wish. You are able to set a new color for any part (date, host, service, message) using regexp based patterns. iykyk. πŸ”₯


πŸ’… COMMAND LINE OPTIONS πŸ’…

Lwatch accepts some command line options. Command line options have precedence over values from the configuration file β€” the CLI is the one who decides, no discussion, periodt.

  • -C filename, --config filename β€” read config from filename instead of /etc/lwatch.conf πŸ’œ
  • -i filename, --input filename β€” read data from named fifo filename instead of /var/lib/syslog.fifo 🌸
  • -o filename, --output filename β€” write colored logs to filename instead of stdout πŸŽ€
  • -s, --show-unparsed β€” show unparsed lines like last message repeated 5 times or --- MARK --- πŸ‘€
  • -d, --daemon β€” run as daemon, detach from control terminal, move to background 🧚
  • -O, --omit-rc β€” do not read values from config file πŸ™ˆ
  • -h, --help β€” show help about runtime option 🫢
  • -v, --version β€” show version and copyright notices ⭐

(yes, -sdOhv is them all bundled up in the synopsis, she's compact like that πŸ’–)


🌟 RUNNING 🌟

Preferred way to run lwatch is to read syslog messages from named fifo or from standard input.

If you use syslog you really want to read messages from a named fifo. To do it, put a line:

*.*                                 |/var/lib/syslog.fifo

in your syslog.conf. Create the appropriate fifo and restart syslog, then run lwatch. You can also run lwatch before starting syslog β€” she's flexible like that πŸ’β€β™€οΈ. If you don't know how to create a named fifo, see mknod(1) for details.

Remember, bestie (this is the important part, don't skip it 😀):

  • fifo must exist
  • proper name must be put in /etc/lwatch.conf or given with the -i command line option

In syslog-ng you can run lwatch directly from syslog, i.e.:

log { source(src); destination(console_all);};
destination console_all {program("/usr/bin/lwatch -i- -o/dev/tty11"); };
🚨 real talk: Lwatch does not support reading from regular files.

If you really need this functionality, use the following command:

tail -f /path/to/filename | /usr/bin/lwatch -i-

It could be subject to change in the future. so watch this space πŸ‘‘ (or don't, she said "could", not "will" πŸ’€)


πŸ”— RESOURCES πŸ”—

go give her a look, she deserves it 🌈


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Regular expression support is provided by the PCRE library package, which is open source software, written by Philip Hazel, and copyright by the University of Cambridge, England. This library is available at: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/

so iconic of them honestly πŸ’œ


πŸ’Œ NOTE FROM AUTHOR πŸ’Œ

I have written this tool for my own needs because perl tools, however flexible, ate a lot of memory and CPU. I have found it useful and I share it with the Open Source Community. But still, developing of this software is driven by my own needs. So, you could expect next release in a year or two ;)

It would be really nice if you could find some time and spare it for rating this project on FreshMeat (see RESOURCES). Comments are welcome too. I cannot promise that I will add new features to lwatch immediately but any positive feedback will raise my motivation level up.

Thank you in advance for your time. 🫢

(not the author promising a new release "in a year or two" β€” king of setting expectations lowkey low, we respect it πŸ˜­πŸ‘‘)


πŸ‘€ SEE ALSO πŸ‘€

lwatch.conf(5)


and that's the whole page, bestie πŸŽ€ you made it to the end of the lwatch(1) manual β€” section 1, General Commands Manual β€” with your girl lwatch closing out the page right where she started. go colorize something pretty. mwah πŸ’–βœ¨

πŸ“¦ where this page comes from