Search in sources :

Example 1 with LogConfig

use of org.apache.geode.internal.logging.LogConfig in project geode by apache.

the class ConnectionNotificationFilterImpl method initLogWriter.

/**
   * Creates a LogWriterI18n for this Agent to use in logging.
   */
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "RV_RETURN_VALUE_IGNORED_BAD_PRACTICE", justification = "Return value for file delete is not important here.")
private void initLogWriter() throws org.apache.geode.admin.AdminException {
    final LogConfig logConfig = this.agentConfig.createLogConfig();
    // LOG: create logWriterAppender here
    this.logWriterAppender = LogWriterAppenders.getOrCreateAppender(LogWriterAppenders.Identifier.MAIN, false, logConfig, false);
    // LOG: look in AgentConfigImpl for existing LogWriter to use
    InternalLogWriter existingLogWriter = this.agentConfig.getInternalLogWriter();
    if (existingLogWriter != null) {
        this.logWriter = existingLogWriter;
    } else {
        // LOG: create LogWriterLogger
        this.logWriter = LogWriterFactory.createLogWriterLogger(false, false, logConfig, false);
        // LOG: changed statement from config to info
        this.logWriter.info(Banner.getString(null));
        // Set this log writer in AgentConfigImpl
        this.agentConfig.setInternalLogWriter(this.logWriter);
    }
    // LOG: create logWriter here
    this.logWriter = LogWriterFactory.createLogWriterLogger(false, false, logConfig, false);
    // Set this log writer in AgentConfig
    this.agentConfig.setInternalLogWriter(this.logWriter);
    // Print Banner information
    logger.info(Banner.getString(this.agentConfig.getOriginalArgs()));
    // LOG:CONFIG: changed next three statements from config to info
    logger.info(LogMarker.CONFIG, LocalizedStrings.AgentImpl_AGENT_CONFIG_PROPERTY_FILE_NAME_0.toLocalizedString(AgentConfigImpl.retrievePropertyFile()));
    logger.info(LogMarker.CONFIG, this.agentConfig.getPropertyFileDescription());
    logger.info(LogMarker.CONFIG, this.agentConfig.toPropertiesAsString());
}
Also used : InternalLogWriter(org.apache.geode.internal.logging.InternalLogWriter) LogConfig(org.apache.geode.internal.logging.LogConfig)

Aggregations

InternalLogWriter (org.apache.geode.internal.logging.InternalLogWriter)1 LogConfig (org.apache.geode.internal.logging.LogConfig)1