tntnet.properties(7)

πŸ“¦ version 2.2.1, in ubuntu jammy

🌸 tntnet.properties β€” the Tntnet users guide, but make it a group chat 🌸

hiii bestie πŸ’– this is the manual page for tntnet.properties(7), straight out of the Tntnet users guide. It's short, it's sweet, and by the end you're gonna be configuring loggers like it's nothing. Let's go πŸ¦‹


✨ NAME ✨

tntnet.properties β€” the configuration-file for tntnet(8) πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

So tntnet(8) uses cxxtools for logging, and it gets all its logging config from the file tntnet.properties. That's the whole thing. That's the file. 🫢

Now here's the plot twist: cxxtools is a meta-logging-library, which means it can literally be compiled to use different logging-libraries under the hood. So the content of tntnet.properties depends on which underlying logging-library you've got. Cxxtools has a built-in logging-library as its default, and that one is what's documented here. Periodt. πŸ’…

πŸŽ€ format πŸŽ€

The format of tntnet.properties is line-based. One line = a variable-name, then an equals-symbol, then a value. That's it, that's the whole grammar, no cap.

Lines that don't follow this format? Ignored. Lines that start with a hash (#)? Also ignored. It is recommended to prefix non-empty comments with a hash so it's crystal clear that it's a comment and not, like, a broken variable. iykyk 😭

🌈 level 🌈

The logging-library has 5 levels for logging:

  1. fatal
  2. error
  3. warn
  4. info
  5. debug

fatal has the highest priority and debug has the lowest. So yeah, fatal is the main character πŸ‘‘ and debug is just vibing in the background.

πŸ¦‹ category πŸ¦‹

Every single log-message has a category. Categories are hierarchical, and the names of subcategories are divided by a dot. Nested vibes only ✨

πŸ”₯ log-message πŸ”₯

Every log-message has a level and a category. Here's the rule, and it's important bestie: if the level of the message is higher or equal to the level of the category, the message is logged.

To assign a level to a category, you put a line in tntnet.properties with the word logger, a dot, the category, the symbol =, and the category. 😌

And the value matching? It's so chill: only the first letter of the value is checked, and case is ignored. So like, info can be written as INFO, info, I, or even ixxxx. Wild, I know, but slay πŸ’…

If no level is specified for the current category, the upper category is checked. If nothing is found up the chain, the default level is used. That default level is specified by the variable rootLogger. And if there's no rootLogger specified at all? Then the level error is used. Simple as that 🫢

πŸ’– destination πŸ’–

If nothing else is specified, log-messages are printed to standard-output. To redirect that output to a file instead, you specify the filename with the variable file.

Now the fun part: the cxxtools-logger can limit the size of the log-file by rolling log-files πŸ”₯. If the limit is reached, the current file is renamed by appending ".1" to it. And if there's already a file with that name, that file gets renamed to "*.2", and so on and so on, until the maximum backupfile limit is reached. At that point the oldest file is deleted. Bye bestie 😭

To specify the maximum file size, set the variable maxfilesize. The value you put there can be postfixed with 'k' or 'M' to specify kBytes or MBytes. The maximum fileindex backed up is set with maxbackupindex. Iconic. ✨

Log-messages can also be sent to another host in the network with udp. You do this by specifying a hostname and a port with the variable host. The value must be a hostname, followed by a ':' and a port. And every single log-message is sent in a single udp-message. One message, one send, no bundling πŸ¦‹


⭐ EXAMPLES ⭐

🌸 logging to standard-output:

rootLogger=INFO
logger.tntnet=WARN

🌸 logging to a file with rolling file and a background-flusher:

rootLogger=INFO
logger.tntnet=WARN
file=tntnet.log
maxfilesize=1MB
maxbackupindex=10

🌸 logging to another host

rootLogger=INFO
logger.tntnet=WARN
host=pluto.tntnet.org:1234

πŸŽ€ AUTHOR πŸŽ€

This manual page was written by Tommi MΓ€kitalo <tommi@tntnet.org>. Thank you for your service πŸ«‘πŸ’–


πŸ’… SEE ALSO πŸ’…


and that's the whole page bestie, you ate it up πŸ“βœ¨ this was Tntnet, dated 2006-08-13, for tntnet.properties(7) β€” go forth and configure your loggers, mwah πŸ’‹πŸŒˆ

πŸ“¦ where this page comes from