jazzdotdev / jazzdotdev/jazz

rundown of log component by sineemore

Open
#162 8 comments 1 reaction 0 assignees View on GitHub
component/logger focus/data focus/mechanics focus/sanity model/report progress/0.5 size/0.75 value/1
Dominant language
Rust
Stars
147
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Currently logs are initialized in [src/lib.rs](/foundpatterns/torchbear/blob/master/src/lib.rs#L232) by Rust part before any Lua code is started. This approach is useful for daemons, but not flexible for interpreter applications.

A bit of background: in my last project I've created a light C init system with supervisor (similar to [runit](http://smarden.org/runit/)). All daemons started by the init system where configured to print logs to stdout. The init system collected the logs via a custom logger in a fashion of `sshd -e ... | logger -rotate 5m /var/log/sshd`. So the logging was managed by the init system and daemons where only configured to print logs to standard output/error. Also I've disabled (where possible) output of timestamps and configured them in my `logger` program, so I have similar logs date format across all system.

My point of view here: even in daemon mode where *out of the box* proper behavior is a desired thing it is required to have additional options I've described above.
___

My thoughts on this:
* initialize logger in Lua part and make it explicit
* allow to store logs in specified directory
* optional log rotate
* allow logging to specified file handle (stdout, stderr, custom file handle) or file path
* optional date format
* [NO_COLOR](https://no-color.org/)
* maybe syslog

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.