1 .. contents:: Table of Contents
4 ========================================
5 Openflowplugin Event Logging Using Log4j
6 ========================================
8 `Openflowplugin Event Logging Reviews <https://git.opendaylight.org/gerrit/#/c/75415/>`__
10 Openflowplugin event logger is the feature which is used to log some important events of openflowplugin into a separate
13 User should configure log4j appender configuration for openflowplugin event logger in ``etc/org.ops4j.pax.logging.cfg``
19 When many log events are available in karaf.log file, it will be difficult for user to quickly find the main events with
20 respect to openflow southbound connection. And also, as there will be huge amount of karaf logs, there are chances of
21 log events getting rolled out in karaf.log files. Due to which we may tend to miss some of the events related to
24 Openflowplugin event logger feature is intended to overcome this problem by logging important events of openflowplugin
25 into a separate file using log4j appender, so that user can quickly refer to these event logs to identify important
26 events of openflowplugin related to connection, disconnection, reconciliation, port events, errors, failures, etc.
30 1. By default openflowplugin event logging feature will not be enabled without any configuration changes in logging
33 2. User can configure log4j appender for openflowplugin event logger(as mentioned in the configuration section) to
34 log the important logs of openflowplugin in a separate file at the path mentioned in configuration file.
38 1. A log4j logger with name ``OfEventLog`` will be created and used to log the event at the time of connection,
39 disconnection, reconciliation, etc.
41 2. By default the event logger logging level is fixed to DEBUG level. Unless there will be a appender configuration
42 present in logging configuration file, the events will not be in enqueued for logging.
44 3. The openflowplugin event logs will be having a pattern consisting of time stamp of the event, description of event
45 followed by the datapathId of the switch for which events are related.
47 4. The event logs will be moved to a separate file(data/events/openflow/openflow.log file as per the configuration
48 mentioned in configuration section) and this can be configured to different path as per the need.
50 5. The file roll over strategy is chosen as to roll events into other file if the current file reaches maximum size(10MB
51 as per configuration) and the event logs will be overwritten if such 10 files(as per configuration) are completed.
53 Command Line Interface (CLI)
54 ============================
70 Below log4j configuration changes should be added in ``etc/org.ops4j.pax.logging.cfg`` file for logging openflowplugin
71 events into a separate file.
74 :caption: org.ops4j.pax.logging.cfg
76 log4j2.logger.ofp.name = OfEventLog
77 log4j2.logger.ofp.level = DEBUG
78 log4j2.logger.ofp.additivity = false
79 log4j2.logger.ofp.appenderRef.OfEventRollingFile.ref = OfEventRollingFile
81 log4j2.appender.ofp.type = RollingRandomAccessFile
82 log4j2.appender.ofp.name = OfEventRollingFile
83 log4j2.appender.ofp.fileName = \${karaf.data}/events/openflow/openflow.log
84 log4j2.appender.ofp.filePattern = \${karaf.data}/events/openflow/openflow.log.%i
85 log4j2.appender.ofp.append = true
86 log4j2.appender.ofp.layout.type = PatternLayout
87 log4j2.appender.ofp.layout.pattern = %d{ISO8601} | %m%n
88 log4j2.appender.ofp.policies.type = Policies
89 log4j2.appender.ofp.policies.size.type = SizeBasedTriggeringPolicy
90 log4j2.appender.ofp.policies.size.size = 10MB
91 log4j2.appender.ofp.strategy.type = DefaultRolloverStrategy
92 log4j2.appender.ofp.strategy.max = 10
93 log4j2.appender.ofp.strategy.fileIndex = min
95 Clustering considerations
96 -------------------------
97 The openflowplugin event logger will be configured in the controller and are related to log events only in that
98 controller. This will not be affecting cluster environment in any way.
100 Other Infra considerations
101 --------------------------
104 Security considerations
105 -----------------------
108 Scale and Performance Impact
109 ----------------------------
125 included with common openflowplugin features.
141 - Somashekhar Javalagi(somashekhar.manohara.javalagi@ericsson.com)
144 - D Arunprakash (d.arunprakash@ericsson.com)
153 This doesn't add any new dependencies.
158 1. Verifying the event logs in karaf.log file, when there is no appender configuration added in logger configuration
160 2. Making appender configuration in logger configuration file and verifying the important events of openflowplugin in
161 the log file specified in configuration.