Logs

The log system has been re-worked in deep in release 0.14.1. This section describes its main characteristics.

Log file

The default log file is /tmp/contextBroker.log. Remember that the directory where the log file is stored (/tmp by default) can be changed using the --logDir command line option.

When starting the Orion context broker, if a previous log file exist:

Log format

The log format is designed to be processed by tools like Splunk or Fluentd.

Each line in the log file is composed by several key-value fields, separed by the pipe character (|). Example:

time=2014-07-18T16:39:06.265CEST | lvl=INFO | trans=N/A | function=main | comp=Orion | msg=contextBroker.cpp[1217]: Orion Context Broker is running
time=2014-07-18T16:39:06.266CEST | lvl=INFO | trans=N/A | function=mongoConnect | comp=Orion | msg=MongoGlobal.cpp[122]: Successful connection to database
time=2014-07-18T16:39:06.266CEST | lvl=INFO | trans=N/A | function=mongoInit | comp=Orion | msg=contextBroker.cpp[1055]: Connected to mongo at localhost:orion
time=2014-07-18T16:39:06.341CEST | lvl=INFO | trans=N/A | function=recoverOntimeIntervalThreads | comp=Orion | msg=MongoGlobal.cpp[421]: Database Operation Successful ({ conditions.type: "ONTIMEINTERVAL" })
time=2014-07-18T16:39:06.452CEST | lvl=INFO | trans=N/A | function=main | comp=Orion | msg=contextBroker.cpp[1290]: Startup completed
...
time=2014-07-18T16:39:22.920CEST | lvl=INFO | trans=1405694346-265-00000000001 | function=connectionTreat | comp=Orion | msg=rest.cpp[615]: Starting transaction from 0.0.0.0:48372/NGSI10/updateContext
time=2014-07-18T16:39:22.922CEST | lvl=INFO | trans=1405694346-265-00000000001 | function=processContextElement | comp=Orion | msg=MongoCommonUpdate.cpp[1499]: Database Operation Successful (...)
time=2014-07-18T16:39:22.922CEST | lvl=INFO | trans=1405694346-265-00000000001 | function=createEntity | comp=Orion | msg=MongoCommonUpdate.cpp[1318]: Database Operation Successful (...)
time=2014-07-18T16:39:22.923CEST | lvl=INFO | trans=1405694346-265-00000000001 | function=addTriggeredSubscriptions | comp=Orion | msg=MongoCommonUpdate.cpp[811]: Database Operation Successful (...)
time=2014-07-18T16:39:22.923CEST | lvl=INFO | trans=1405694346-265-00000000001 | function=addTriggeredSubscriptions | comp=Orion | msg=MongoCommonUpdate.cpp[811]: Database Operation Successful (...)
time=2014-07-18T16:39:22.923CEST | lvl=INFO | trans=1405694346-265-00000000001 | function=connectionTreat | comp=Orion | msg=rest.cpp[745]: Transaction ended
...
time=2014-07-18T16:39:35.415CEST | lvl=INFO | trans=1405694346-265-00000000002 | function=connectionTreat | comp=Orion | msg=rest.cpp[615]: Starting transaction from 0.0.0.0:48373/NGSI10/queryContext
time=2014-07-18T16:39:35.416CEST | lvl=INFO | trans=1405694346-265-00000000002 | function=entitiesQuery | comp=Orion | msg=MongoGlobal.cpp[877]: Database Operation Successful (...)
time=2014-07-18T16:39:35.416CEST | lvl=INFO | trans=1405694346-265-00000000002 | function=connectionTreat | comp=Orion | msg=rest.cpp[745]: Transaction ended
...
time=2014-07-18T16:41:34.254CEST | lvl=INFO | trans=N/A | function=mongoGetContextSubscriptionInfo | comp=Orion | msg=mongoOntimeintervalOperations.cpp[58]: Database Operation Successful (findOne _id: 53c8c29d09b4f403b165ff61)
time=2014-07-18T16:41:34.255CEST | lvl=INFO | trans=N/A | function=entitiesQuery | comp=Orion | msg=MongoGlobal.cpp[877]: Database Operation Successful (...)
time=2014-07-18T16:41:34.255CEST | lvl=INFO | trans=1405694174-239-00000000015 | function=doNotification | comp=Orion | msg=onTimeIntervalThread.cpp[89]: Starting transaction to http://localhost:1028/accumulate
time=2014-07-18T16:41:34.255CEST | lvl=INFO | trans=1405694174-239-00000000015 | function=mongoUpdateCsubNewNotification | comp=Orion | msg=mongoOntimeintervalOperations.cpp[175]: Database Operation Successful (...)
time=2014-07-18T16:41:34.255CEST | lvl=INFO | trans=1405694174-239-00000000015 | function=sendHttpSocket | comp=Orion | msg=clientSocketHttp.cpp[376]: Notification Successfully Sent to 10.0.0.1:1028/accumulate
time=2014-07-18T16:41:34.255CEST | lvl=INFO | trans=1405694174-239-00000000015 | function=sendHttpSocket | comp=Orion | msg=clientSocketHttp.cpp[377]: Transaction ended
...
time=2014-07-18T16:44:53.541CEST | lvl=INFO | trans=N/A | function=sigHandler | comp=Orion | msg=contextBroker.cpp[968]: Signal Handler (caught signal 2)
time=2014-07-18T16:44:53.541CEST | lvl=INFO | trans=N/A | function=sigHandler | comp=Orion | msg=contextBroker.cpp[974]: Orion context broker exiting due to receiving a signal

The different fields in each line are as follows:

Error and warning types

Alarm conditions

Alarm ID Severity Detection strategy Stop condition Description Action
1 CRITICAL A FATAL trace is found The following INFO text trace appear: "Startup completed"" A problem has happend at Orion Context Broker startup. The FATAL 'msg' field details the particular problem. Solving the issue that is precluding Orion Context Broker startup, e.g. if the problem was due to the listening port is being used the solution would be either changing Orion listening port or ending the process that is already using the port.
2 CRITICAL The following ERROR text appears in the 'msg' field: "Database Error (...)" The following INFO text appears in the 'msg' field: "Database Operation Successful (...)" Database Error. The text within parenthesis in the 'msg' field containts the detailed information. Orion is unable to access MongoDB database and/or MongoDB database is not working properly. Check database connection and database status. Once repaired the database and/or its connection from Orion, the problem should disapear (Orion service restart is not needed). No specific fixing action has to be done at Orion Context Broker service.
3 CRITICAL The following ERROR text appears in the 'msg' field: "Runtime Error (...)" N/A Runtime Error. The text within parenthesis in the 'msg' field containts the detailed information. Restart Orion Context Broker. If it persits (e.g. new Runtime Errors appear within the next hour), scale up the problem to development team.
4 WARNING The following WARNING text appear in the 'msg' field: "Bad Input (...)" A transaction comming from the same client (identified by IP and port) is processed correctly, without any "Bad Input (...)" message between the "Starting transaction from" message to the "Transaction ended" message for that particular transaction. Bad Input. The text within parenthesis in the 'msg' field containts the detailed information. The client has sent a request to Orion that doesn't conform to the API specification, e.g. bad URL, bad payload, syntax/semantic error in the request, etc. Depending on the IP, it could correspond to a platform client or to an external third-party client. In any case, the client owner should be reported in order to know and fix the issue. No specific fixing action has to be done at Orion Context Broker service.
5 WARNING The following WARNING text appears in the 'msg' field: "Notification failure for (...)" The following INFO text appears in the 'msg' field: "Notification Successfully Sent to ", where is the same one that triggered the alarm. Notification Failure. The text within parenthesis in the 'msg' field containts the detailed information. Orion is trying to send the notification to a given receiver and some problem has happended. It could be due to a problem on the network connectivy or on the receiver e.g. the receiver is down. In the second case, the owner of the receiver of the owner should be reported. No specific fixing action has to be done at Orion Context Broker service.

Log rotation

Logrotate is installed as RPM dependency along with contextBroker. The system is configure to rotate every day and whenever the log file size is greater than 100MB (checked very 30 minutes by default):

Depending on your expected load you would need to adjust the default settings. In this sense, take into account that every transaction can consume around 1-2 KB (measured with Orion 0.14.1), e.g. if your expected load is around 200 TPS, then your log file will grow 200-400 KB per second.