Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Conversation

@pettermahlen
Copy link
Member

This PR adds (yet) another SyslogAppender subclass that replicates some of the configuration
setup done by LoggingConfigurator. The idea is to make it possible to easily use a regular logback.xml file and not have to use the programmatic API exposed by LoggingConfigurator.

An example logback.xml file illustrating usage:

<configuration>

    <appender name="syslog" class="com.spotify.logging.logback.EnvironmentVariableSyslogAppender">
        <serviceName>acoolservice</serviceName>
    </appender>

   <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="DEBUG">
        <appender-ref ref="syslog" />
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

This is intended to support the same logging functionality as LoggingConfigurator,
but to be configurable via the standard logback configuration methods.
@pettermahlen
Copy link
Member Author

@jo-ri

- rename EnvironmentVariableSyslogAppender to SpotifyInternalAppender
- improve javadocs
- remove ability to configure environment variables, since logback provides support
  for that out of the box.
}

@Test
public void shouldAddIdentToSuffixPattern() throws Exception {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldAddServiceNameToSuffixPattern?

@jo-ri
Copy link

jo-ri commented Aug 3, 2016

+1

@pettermahlen pettermahlen merged commit 9e91b70 into spotify:master Aug 3, 2016
@pettermahlen pettermahlen deleted the environment-based-appender branch August 3, 2016 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants