Alarms and Logging
The OCS uses the Logback configurable logging mechanism for logging alarms to server logs. Targeted tracing can be applied to an executing OCS server if required to help with debugging and problem identification.
Example Production Logging Configuration
The following production logging configuration can be used for the OCS. This logging mechanism will log all alarm messages
Place this in configuration in the file /etc/n2ocs/logback.xml
and set
the logback configuration reference (see configuration) to use it.
<configuration>
<property name="LOGDIR" value="/var/log/n2ocs" />
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
<syslogHost>localhost</syslogHost>
<facility>SYSLOG</facility>
<port>514</port>
<suffixPattern>n2ocs %d{ISO8601,UTC} %p %t %c %M - %m%n</suffixPattern>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOGDIR}/n2ocs.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<FileNamePattern>${LOGDIR}/n2ocs.%d{yyyy-MM-dd}.%i.log.gz
</FileNamePattern>
<!-- keep lots of history -->
<MaxHistory>120</MaxHistory>
<!-- or whenever the file size reaches a large size -->
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>20MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%date [%thread] %-5level %logger{36}:%line - %msg%n</Pattern>
</encoder>
</appender>
<!--
LOG INFO AND ABOVE ONLY
-->
<root level="INFO">
<appender-ref ref="FILE" />
<appender-ref ref="SYSLOG" />
</root>
</configuration>
Statistics
Each OCS instance generates metrics which are delivered over the graphite protocol to an external statistics aggregation server.
Tools such as graphite may then be used to monitor statistics from the OCS or OCS cluster.
The following statisic groups are available.
All statistics are prefixed with vertx.http.servers.<host>:<port>
so that each OCS server’s statistics are uniquely identifiable.
Statistic | Description |
---|---|
requests |
Metrics of the number of requests made in aggregate to the server. |
<http-method>-requests |
Metrics of the number of specific http method request made to the server. For example: get-requests . |
responses-1xx |
Metrics of the number of responses with a status code between 100 and 199. |
responses-2xx |
Metrics of the number of responses with a status code between 200 and 299. 2xx responses indicate a successful request. |
responses-3xx |
Metrics of the number of responses with a status code between 300 and 399. |
responses-4xx |
Metrics of the number of responses with a status code between 400 and 499. 4xx responses generally indicate a client request failure. |
responses-5xx |
Metrics of the number of responses with a status code between 500 and 599. 5xx responses indicate a server failure. |