1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-28 13:49:13 -05:00
forgejo/modules/log
Ivan Shapovalov 012a1e0497 log: journald integration (#2869)
Provide a bit more journald integration. Specifically:

- support emission of printk-style log level prefixes, documented in [`sd-daemon`(3)](https://man7.org/linux/man-pages/man3/sd-daemon.3.html#DESCRIPTION), that allow journald to automatically annotate stderr log lines with their level;
- add a new "journaldflags" item that is supposed to be used in place of "stdflags" when under journald to reduce log clutter (i. e. strip date/time info to avoid duplication, and use log level prefixes instead of textual log levels);
- detect whether stderr and/or stdout are attached to journald by parsing `$JOURNAL_STREAM` environment variable and adjust console logger defaults accordingly.

<!--start release-notes-assistant-->

## Draft release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/2869): <!--number 2869 --><!--line 0 --><!--description bG9nOiBqb3VybmFsZCBpbnRlZ3JhdGlvbg==-->log: journald integration<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2869
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Ivan Shapovalov <intelfx@intelfx.name>
Co-committed-by: Ivan Shapovalov <intelfx@intelfx.name>
2024-08-09 07:49:13 +00:00
..
color.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
color_console.go log: journald integration (#2869) 2024-08-09 07:49:13 +00:00
color_console_other.go log: journald integration (#2869) 2024-08-09 07:49:13 +00:00
color_console_windows.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
color_router.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
event_format.go log: journald integration (#2869) 2024-08-09 07:49:13 +00:00
event_format_test.go log: journald integration (#2869) 2024-08-09 07:49:13 +00:00
event_writer.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
event_writer_base.go Reduce some allocations in type conversion (#26772) 2023-08-29 00:43:16 +08:00
event_writer_conn.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
event_writer_conn_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
event_writer_console.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
event_writer_file.go Use stderr as fallback if the log file can't be opened (#26074) 2023-07-24 04:57:21 +00:00
flags.go log: journald integration (#2869) 2024-08-09 07:49:13 +00:00
flags_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
groutinelabel.go Update go dev dependencies (#22064) 2022-12-08 16:21:37 +08:00
groutinelabel_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
init.go Do not output "Trace" level logs from process manager by default (#24952) 2023-05-27 10:55:24 +00:00
level.go log: journald integration (#2869) 2024-08-09 07:49:13 +00:00
level_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
logger.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
logger_global.go Fix sub-command log level (#25537) 2023-06-28 08:02:06 +02:00
logger_impl.go Fix sub-command log level (#25537) 2023-06-28 08:02:06 +02:00
logger_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
manager.go Do not output "Trace" level logs from process manager by default (#24952) 2023-05-27 10:55:24 +00:00
manager_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
misc.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00
stack.go Rewrite logger system (#24726) 2023-05-21 22:35:11 +00:00