[Asterisk-code-review] main/logger: Add log formatters and JSON structured logs (asterisk[master])
Matt Jordan
asteriskteam at digium.com
Mon Sep 28 09:35:36 CDT 2015
Hello Joshua Colp,
I'd like you to reexamine a change. Please visit
https://gerrit.asterisk.org/1333
to look at the new patch set (#2).
Change subject: main/logger: Add log formatters and JSON structured logs
......................................................................
main/logger: Add log formatters and JSON structured logs
When Asterisk is part of a larger distributed system, log files are often
gathered using tools (such as logstash) that prefer to consume information
and have it rendered using other tools (such as Kibana) that prefer a
structured format, e.g., JSON. This patch adds support for JSON formatted
logs by adding support for an optional log format specifier in Asterisk's
logging subsystem. By adding a format specifier of '[json]':
full => [json]debug,verbose,notice,warning,error
Log messages will be output to the 'full' channel in the following
format:
{
"hostname": Hostname or name specified in asterisk.conf
"timestamp": Date/Time
"identifiers": {
"lwp": Thread ID,
"callid": Call Identifier
}
"logmsg": {
"location": {
"filename": Name of the file that generated the log statement
"function": Function that generated the log statement
"line": Line number that called the logging function
}
"level": Log level, e.g., DEBUG, VERBOSE, etc.
"message": Actual text of the log message
}
}
ASTERISK-25425 #close
Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
---
M CHANGES
M configs/samples/logger.conf.sample
M main/logger.c
3 files changed, 261 insertions(+), 100 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/33/1333/2
--
To view, visit https://gerrit.asterisk.org/1333
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8649bfedf3fb7bf3138008cc11565553209cc238
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-code-review
mailing list