Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Capgemini/logback-access-gelf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logback-access-gelf : A GELF Appender for Logback Access

Use this appender to log access logs to a Graylog2 server via GELF messages.

This extends the functionality for logback-gelf for sending access log to Graylog Server.

Using Logback Access

Dependency :

<dependency>
	<groupId>com.capgemini</groupId>
	<artifactId>logback-access-gelf</artifactId>
	<version>0.0.4</version>
</dependency>

Configuring Logback-Access

Add the following to your logback-access.xml configuration file.

<configuration>
    <appender name="GELF" class="com.capgemini.logbackaccess.gelf.AccessLogGelfAppender">
    		<facility>sample-service-access</facility>
    		<graylog2ServerHost>localhost</graylog2ServerHost>
    		<graylog2ServerPort>8003</graylog2ServerPort>
    		<useMarker>true</useMarker>
    		<graylog2ServerVersion>0.9.6</graylog2ServerVersion>
    		<requestURI>true</requestURI>
    		<remoteHost>true</remoteHost>
    		<protocol>true</protocol>
    		<method>true</method>
    		<statusCode>true</statusCode>
    		<contentLength>true</contentLength>
    		<responseContent>true</responseContent>
    		<headers>Test-Header</headers>
    	</appender>
     <appender-ref ref="GELF" />
</configuration>

Properties

  • facility: The name of your service. Appears in facility column in graylog2-web-interface. Defaults to "GELF"
  • graylog2ServerHost: The hostname of the graylog2 server to send messages to. Defaults to "localhost"
  • graylog2ServerPort: The graylog2ServerPort of the graylog2 server to send messages to. Defaults to 12201
  • staticAdditionalFields: See static additional fields below. Defaults to empty
  • contentLength: Boolean : to send content length to graglog
  • header: String,: List all headers you want to log with comma(,) separated.

Static Additional Fields

Use static additional fields when you want to add a static key value pair to every GELF message. Key is the additional field key (and should thus begin with an underscore). The value is a static string.

E.g in the appender configuration:

    <appender name="GELF" class="GelfAppender">
        ...
        <staticAdditionalField>_node_name:www013</staticAdditionalField>
        ...
    </appender>
    ...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%