All Downloads are FREE. Search and download functionalities are using the official Maven repository.

easyj.logging.logback.appenders.logstash-appender.xml Maven / Gradle / Ivy

There is a newer version: 0.7.8
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<included>
	<if condition='"true".equalsIgnoreCase(property("LOGSTASH_ENABLED"))'>
		<then>
			<!-- logstash-appender properties -->
			<springProperty name="LOGSTASH_DESTINATION" source="easyj.logging.logback.logstash-appender.destination"
							defaultValue="127.0.0.1:4560"/>
			<springProperty name="LOGSTASH_QUEUE_SIZE" source="easyj.logging.logback.logstash-appender.queue-size"
							defaultValue="8192"/>

			<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
				<!-- the TCP address of the logstash -->
				<destination>${LOGSTASH_DESTINATION}</destination>
				<queueSize>${LOGSTASH_QUEUE_SIZE}</queueSize>

				<!--<encoder charset="UTF-8" class="net.logstash.logback.encoder.LogstashEncoder">-->
				<encoder charset="UTF-8" class="icu.easyj.spring.boot.logging.logback.appender.logstash.EnhancedLogstashEncoder">
					<!-- the global custom fields -->
					<customFields>
						{
						"app_name": "${APPLICATION_NAME}",
						"server_host": "${SERVER_HOST}",
						"server_port": ${SERVER_PORT},
						"pid": ${PID:-0}
						}
					</customFields>

					<!-- Exclude the provider of data `@version` -->
					<excludeProvider>net.logstash.logback.composite.LogstashVersionJsonProvider</excludeProvider>
					<!-- Exclude providers that are not currently needed, reduce some performance loss. -->
					<excludeProvider>net.logstash.logback.composite.loggingevent.JsonMessageJsonProvider</excludeProvider>
					<excludeProvider>net.logstash.logback.composite.loggingevent.TagsJsonProvider</excludeProvider>
					<excludeProvider>net.logstash.logback.composite.loggingevent.LogstashMarkersJsonProvider</excludeProvider>
					<excludeProvider>net.logstash.logback.composite.loggingevent.ArgumentsJsonProvider</excludeProvider>
				</encoder>
			</appender>
		</then>
	</if>
</included>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy