...
SffLog | Log4j Configured | Result | Comments |
---|---|---|---|
sff.log=disabled,silent | YES | No Logs |
|
sff.log=enabled,silent | YES; sff.log.level="INFO" | Only INFO Level log statements as specified in log4j appender | Absolutely no log file at all |
sff.log=enabled,loud | YES; sff.log.level="INFO" | INFO, ERROR and WARN statements are printed in log | Note that sff.log.level is passed into rootLogger value of Log4j configurationAdmin |
sff.log=enabled,loud | YES; sff.log.level="DEBUG" | INFO, ERROR, WARN, DEBUG statements are printed in log | |
sff.log=enabled,loud sff.log.trace=enabled | YES; sff.log.level="TRACE" | Trace will be enabled; Trace allows you to view Protocol level details for example | This is how trace can be enabled. |
Logging Cost
- Note that Log statements that has Template Processing (TP) in message will be evaluated independent of the level.
- Note the only TP will be processed but Strings will NOT be generated if level is not enabled.
- There is a potential to optimize not to perform TP based on level as well. (Enhancement)
Broadcast Log Message
A-Stack allows users to provide facet id on which all the log messages can be broadcast.
...
- sff.log.broadcast.<log level name> which defines one or more facet IDs used for log broadcasting. That is:
- <sff.log.broadcast.error>[:MyErrorsFacet:]</sff.log.broadcast.error> - This one will broadcast log error messages to [randomized] [:MyErrorsFacet:] fid
- <sff.log.broadcast.all>wstest</sff.log.broadcast.all> - This one will log messages to wstest fid.
You can specify more than one fid as comma-separated list. - Known Log levels are:
- text
- trace
- debug
- info
- warn
- error
- fatal
- all
sff.log.broadcast.protocol. Default value is “ws,wss”. This is the list of protocols which will be used to select broadcast pipelines. That is, it will *not* broadcast on HTTP connections, for example. When broadcast is enabled, startup will log the list of protocols so you know it was enabled. Obviously, it will *not* print the list of facet IDs used for broadcast.
sff.log.broadcast.message. This is log message definition. It may come in different forms:
<sff.log.broadcast.message>json<sff.log.broadcast.message> This simplest form allows you to define log message type (e.g. xml or json). Default is xml.
Default message in JSON format will look like this:
Code Block language text title Default Message linenumbers true { "Log": { "Level":"WARN", "Source":"SffSequenceFacet", "Timestamp":1479334740055, "Message":"startSchedularForMonitorStatus:MonitorStatus 1:0 @ Wed Nov 16 14:19:00 PST 2016: Scheduled: skip past (-55 ms) event for Wed Nov 16 14:19:00 PST 2016 [0../30sec]" } }
In XML Format:
Code Block language xml title Default Message linenumbers true <Log> <Level>WARN</Level> <Source>SffSequenceFacet</Source> <Timestamp>1479334740055<Timestamp> <Message>startSchedularForMonitorStatus:MonitorStatus 1:0 @ Wed Nov 16 14:19:00 PST 2016: Scheduled: skip past (-55 ms) event for Wed Nov 16 14:19:00 PST 2016 [0../30sec]</Message> </Log>
In CDM Format:
Code Block language xml title Default Message linenumbers true # Log: Level: WARN Source: SffSequenceFacet Timestamp: 1479334740055 Message: "startSchedularForMonitorStatus:MonitorStatus 1:0 @ Wed Nov 16 14:19:00 PST 2016: Scheduled: skip past (-55 ms) event for Wed Nov 16 14:19:00 PST 2016 [0../30sec]"
Log messages are automatically added to the logger window on TQLConsole
Application Monitoring Using Broadcast Facet
Users can build monitoring application applications or application applications that require to know if Runtime has started etc using the Broadcast facet.
Elastic Search Integration
- Copy Elastic Search, Kibana, Filebeat and Logstash from below link
- http://sandbox.atomiton.com:8080/fid-downloads/res/downloads/loganalysis.zip
- Unzip and update filebeat configuration to read log file from given location
- Path – filebeat/filebeat.yml
- Add below lines for each log file
- input_type: log
paths:
- /<Path>/deviceEngine.log
fields: {host: "172.31.48.38", port: "8085", type: "logs"}
exclude_lines: [".*SffReport:.*"]
####################################
- input_type: log
paths:
- /<Path> /deviceEngine.log
fields: {host: "172.31.48.38", port: "8085", type: "SffReport"}
include_lines: [".*SffReport:.*"]
- Start each service using below commands –
- Elastic search –
- Path to execute command - elasticsearch/bin
- Command - nohup ./elasticsearch > /dev/null &
- Logstash –
- Path to execute command - logstash/logstash/bin
- Command - nohup ./logstash -f logstash-engine.conf > /dev/null &
- Filebeat –
- Path to execute command – filebeat/
- Command - nohup ./filebeat > nohup.out &
- Kibana –
- Path to execute command – kibana/bin
- Command - nohup ./kibana > nohup.out &
- Kibana will start on port 5601
- URL to access Kibana - http://<host>:5601/app/kibana