Log Configuration Files Example

Two logging options can be used for IBM® AD Analyze Client. You can select one of the logging options.
  • LogConfigurator.properties

    LogConfigurator.properties allows the user to customize the amount of details that is generated about errors. LogConfigurator.properties is created by the user, and it is fully configurable. To use LogConfigurator.properties for log configuration, you must create the file under <Eclipse Workspace folder>\.metadata\.ez\ folder and make sure that Enable easy log4j configuration syntax is checked. Then, click Reload Log Configuration button from General settings preferences page, and click Apply or Apply and Close.

    Following is an example of a LogConfigurator.properties file.
    com.ez=info
    com.ez.graphs.viewer.odb=debug
    Note: LogConfigurator.properties is used only in IBM AD Analyze Client. For more information about activating the debug logs for IBM AD Analyze Client, see Activating the debug logs for IBM AD Analyze Client.
  • log4j2.xml

    If you use log4j2.xml to configure log4j2 logger, you must create a log4j2.xml file under <Eclipse Workspace folder>\.metadata\.ez\ folder and make sure that Enable easy log4j configuration syntax is unchecked. Then, click Reload Log Configuration button from General settings preferences page, and click Apply or Apply and Close.

    Following is an example of a log4j2.xml file.

    <?xml version="1.0" encoding="UTF-8"?> 
    <Configuration status="INFO">
      <Appenders>
        <File name="file" fileName="${sys:log4j.dir}/ez.log">
          <PatternLayout>
            <Pattern>%-5p %d [%t] %c - %m %ex%n</Pattern>
          </PatternLayout>
        </File>
        <Console name="STDOUT" target="SYSTEM_OUT">
          <PatternLayout pattern="%-5p %d [%t] %c - %m %ex%n"/>
        </Console>
      </Appenders>
      <Loggers>
    	    <Root>
    	    	<AppenderRef ref="file" level="WARN"/>
    	    	<AppenderRef ref="STDOUT" level="INFO"/>
    	    </Root>
    		<Logger name="com.ez.workspace.analysis.graph.job" level="INFO">
    		</Logger>
    	    <Logger name="com.ez.ezsource.connection.zkbridge" level="WARN">
    		</Logger>
    		<Logger name="com.ez.eclient.zkbridge" level="ERROR">
    		</Logger>
    		<Logger name="org.apache.zookeeper" level="ERROR">
    		</Logger>
    		<Logger name="Unknown" level="ERROR">
    		</Logger>
    		<Logger name="EZSourceConnectionService" level="ERROR">
    		</Logger>
    		<Logger name="com.googlecode.protobuf.pro" level="INFO">
    		</Logger>
      </Loggers>
    </Configuration>