journald formatter

JUL Formatter which sends logs to journald with proper log level

Лицензия

Лицензия

Категории

Категории

ORM Данные
Группа

Группа

ru.r2cloud
Идентификатор

Идентификатор

journald-formatter
Последняя версия

Последняя версия

1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

journald formatter
JUL Formatter which sends logs to journald with proper log level
Ссылка на сайт

Ссылка на сайт

https://github.com/dernasherbrezon/journald-formatter
Система контроля версий

Система контроля версий

https://github.com/dernasherbrezon/journald-formatter

Скачать journald-formatter

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/ru.r2cloud/journald-formatter/ -->
<dependency>
    <groupId>ru.r2cloud</groupId>
    <artifactId>journald-formatter</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/ru.r2cloud/journald-formatter/
implementation 'ru.r2cloud:journald-formatter:1.0'
// https://jarcasting.com/artifacts/ru.r2cloud/journald-formatter/
implementation ("ru.r2cloud:journald-formatter:1.0")
'ru.r2cloud:journald-formatter:jar:1.0'
<dependency org="ru.r2cloud" name="journald-formatter" rev="1.0">
  <artifact name="journald-formatter" type="jar" />
</dependency>
@Grapes(
@Grab(group='ru.r2cloud', module='journald-formatter', version='1.0')
)
libraryDependencies += "ru.r2cloud" % "journald-formatter" % "1.0"
[ru.r2cloud/journald-formatter "1.0"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

About Build Status Quality Gate Status

This project provides special JUL formatter. It will format log levels as numbers instead of strings. These numbers are from syslog format. Using these numbers could help you assign proper log level in journald. See the example below.

Example configuration

Here is example configuration:

java.util.logging.ConsoleHandler.formatter=ru.r2cloud.logging.JournaldFormatter
java.util.logging.JournaldFormatter.format=<%4$s>%5$s%6$s [%2$s]%n

It looks like a normal SimpleFormatter configuration. The trick is in <%4$s>. When java process outputs log entries with such prefix, journald can parse them and assign proper level. Later on, these log entries could be searched, parsed, analyzed via journalctl:

journalctl -u myservice -p err -n 20 

Версии библиотеки

Версия
1.0