1.6 Logging

This section describes the Oracle Enterprise Manager for MySQL Database logging. For information on the Oracle Management Service or Management Agent logs, see Locating and Configuring Enterprise Manager Log Files.

Management Agent uses the log4j library for all agent and plugin logging. The logging configuration is defined by the properties of the log4j2.xml file.

Log files specific to the Oracle Enterprise Manager for MySQL Database are written to the following location of your OEM Agent installation:

/plugins/oracle.mysql.omys.agent.plugin_versionNumber/scripts/oracle_omys_database/logs

The log configuration is stored in the following directory of your OEM Agent installation:

/plugins/oracle.mysql.omys.agent.plugin_versionNumber/scripts/oracle_omys_database/etc

where versionNumber is the version of the plugin.

The auto-discovery plugin's logging is also configured by a log4j2.xml configuration. By default this file is created in the /plugins/oracle.mysql.omys.discovery.plugin_versionNumber/etc directory of your Management Agent installation.

The default auto-discovery log output directory is: /plugins/oracle.mysql.omys.discovery.plugin_versionNumber/logs

versionNumber is the version of the plugin.

The following is an example of the log4j2.xml file:

<Configuration status="INFO">
    <Properties>
        <Property name="logging.filename">myoem</Property>
    </Properties>

    <Appenders>
        <Console name="stdout" target="SYSTEM_OUT">
            <PatternLayout pattern="%d %5p [%t:%c{3}] %m%n"/>
        </Console>

        <RollingFile name="pluginFile" fileName="${sys:logging.path}/${sys:logging.filename}.log"
                    filePattern="${sys:logging.path}/${sys:logging.filename}.log.%i">
            <PatternLayout>
                <Pattern>%d %5p [%t:%c] %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <SizeBasedTriggeringPolicy size="10 MB"/>
            </Policies>
            <DefaultRolloverStrategy max="10"/>
        </RollingFile>
    </Appenders>

    <Loggers>
        <Root level="info">
            <AppenderRef ref="pluginFile"/>
        </Root>

        <Logger name="com.mysql.etools.emplugin.collection.availability" level="info"/>
        <Logger name="com.mysql.etools.emplugin.collection.discovery" level="info"/>
        <Logger name="com.mysql.etools.emplugin.collection.assets" level="info"/>
        <Logger name="com.mysql.etools.emplugin.collection.manufactured" level="info"/>

    </Loggers>
</Configuration>

A general log and collection-type logs are generated for each monitored MySQL instance. The collection-type logs, defined by the com.mysql.etools.emplugin.collection.* properties, which are at INFO level by default, log details of availability, metrics, response times, and so on. One log file is generated for each collection type. The general log provides logging details of the plugin behavior, errors, status messages and so on. The log files rollover at 10MB and up to 10 files per log type are retained. Logs older than the 10-file limit are deleted.

It is not recommended to edit the log properties unless requested to do so by your Support representative.