All Projects → osiegmar → Logback Gelf

osiegmar / Logback Gelf

Licence: lgpl-2.1
Logback appender for sending GELF messages with zero additional dependencies.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Logback Gelf

Knetstat
Simple kernel module to inspect socket options
Stars: ✭ 134 (-8.22%)
Mutual labels:  tcp, udp
Ngx healthcheck module
nginx module for upstream servers health check. support stream and http upstream. 该模块可以为Nginx提供主动式后端服务器健康检查的功能(同时支持四层和七层后端服务器的健康检测)
Stars: ✭ 145 (-0.68%)
Mutual labels:  tcp, udp
Pingtunnel
ping tunnel is a tool that advertises tcp/udp/socks5 traffic as icmp traffic for forwarding.
Stars: ✭ 1,904 (+1204.11%)
Mutual labels:  tcp, udp
Reactor Netty
TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
Stars: ✭ 1,743 (+1093.84%)
Mutual labels:  tcp, udp
Pbscan
Faster and more efficient stateless SYN scanner and banner grabber due to userland TCP/IP stack usage.
Stars: ✭ 122 (-16.44%)
Mutual labels:  tcp, udp
Esp8266 Wifi Uart Bridge
Transparent WiFi (TCP, UDP) to UART Bridge, in AP or STATION mode
Stars: ✭ 107 (-26.71%)
Mutual labels:  tcp, udp
Fi6s
IPv6 network scanner designed to be fast
Stars: ✭ 116 (-20.55%)
Mutual labels:  tcp, udp
N2o
⭕ N2O: Distributed Application Server
Stars: ✭ 1,262 (+764.38%)
Mutual labels:  tcp, udp
Go Netstat
A netstat implementation written in Go
Stars: ✭ 121 (-17.12%)
Mutual labels:  tcp, udp
Gobetween
☁️ Modern & minimalistic load balancer for the Сloud era
Stars: ✭ 1,631 (+1017.12%)
Mutual labels:  tcp, udp
Oscp5
An Open Sound Control (OSC) implementation for Java and Processing
Stars: ✭ 103 (-29.45%)
Mutual labels:  tcp, udp
Async Sockets Cpp
Simple thread-based asynchronous TCP & UDP Socket classes in C++.
Stars: ✭ 127 (-13.01%)
Mutual labels:  tcp, udp
Packetsender
Network utility for sending / receiving TCP, UDP, SSL
Stars: ✭ 1,349 (+823.97%)
Mutual labels:  tcp, udp
Ddos Rootsec
DDOS Archive by RootSec (Scanners, BotNets (Mirai and QBot Premium & Normal and more), Exploits, Methods, Sniffers)
Stars: ✭ 108 (-26.03%)
Mutual labels:  tcp, udp
T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+811.64%)
Mutual labels:  tcp, udp
Stream
NodeJS Modbus Stream
Stars: ✭ 114 (-21.92%)
Mutual labels:  tcp, udp
Logbert
Logbert is an advanced log message viewer for log4net, log4j and others.
Stars: ✭ 70 (-52.05%)
Mutual labels:  tcp, udp
Objectdeliverer
ObjectDeliverer is a data transmission / reception library for Unreal Engine (C ++, Blueprint).
Stars: ✭ 78 (-46.58%)
Mutual labels:  tcp, udp
Goproxy
🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。
Stars: ✭ 11,334 (+7663.01%)
Mutual labels:  tcp, udp
Socket
Non-blocking socket and TLS functionality for PHP based on Amp.
Stars: ✭ 122 (-16.44%)
Mutual labels:  tcp, udp

Logback GELF

build javadoc Maven Central

Logback appender for sending GELF (Graylog Extended Log Format) messages with zero additional dependencies.

Features

  • UDP (with chunking)
  • TCP (with or without TLS encryption)
  • Deflate compression in UDP mode
  • Client side load balancing (round robin)
  • Forwarding of MDC (Mapped Diagnostic Context)
  • Forwarding of caller data
  • Forwarding of static fields
  • Forwarding of exception root cause
  • No runtime dependencies beside Logback

Requirements

  • Java 8
  • Logback 1.2.3

Examples

Simple UDP configuration:

<configuration>

    <appender name="GELF" class="de.siegmar.logbackgelf.GelfUdpAppender">
        <graylogHost>localhost</graylogHost>
        <graylogPort>12201</graylogPort>
    </appender>

    <root level="debug">
        <appender-ref ref="GELF" />
    </root>

</configuration>

Simple TCP configuration:

<configuration>

    <appender name="GELF" class="de.siegmar.logbackgelf.GelfTcpAppender">
        <graylogHost>localhost</graylogHost>
        <graylogPort>12201</graylogPort>
    </appender>

    <!-- Use AsyncAppender to prevent slowdowns -->
    <appender name="ASYNC GELF" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="GELF" />
    </appender>

    <root level="debug">
        <appender-ref ref="ASYNC GELF" />
    </root>

</configuration>

Simple TCP with TLS configuration:

<configuration>

    <appender name="GELF" class="de.siegmar.logbackgelf.GelfTcpTlsAppender">
        <graylogHost>localhost</graylogHost>
        <graylogPort>12201</graylogPort>
    </appender>

    <!-- Use AsyncAppender to prevent slowdowns -->
    <appender name="ASYNC GELF" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="GELF" />
    </appender>

    <root level="debug">
        <appender-ref ref="ASYNC GELF" />
    </root>

</configuration>

Find more advanced examples in the examples directory.

Configuration

Appender

de.siegmar.logbackgelf.GelfUdpAppender

  • graylogHost: IP or hostname of graylog server. If the hostname resolves to multiple ip addresses, round robin will be used.
  • graylogPort: Port of graylog server. Default: 12201.
  • encoder: See Encoder configuration below.
  • maxChunkSize: Maximum size of GELF chunks in bytes. Default chunk size is 508 - this prevents IP packet fragmentation. This is also the recommended minimum. Maximum supported chunk size is 65,467 bytes.
  • useCompression: If true, compression of GELF messages is enabled. Default: true.
  • messageIdSupplier: The mechanism that supplies unique message ids that are required by the GELF UDP protocol. Default: de.siegmar.logbackgelf.MessageIdSupplier.

de.siegmar.logbackgelf.GelfTcpAppender

  • graylogHost: IP or hostname of graylog server. If the hostname resolves to multiple ip addresses, round robin will be used.
  • graylogPort: Port of graylog server. Default: 12201.
  • encoder: See Encoder configuration below.
  • connectTimeout: Maximum time (in milliseconds) to wait for establishing a connection. A value of 0 disables the connect timeout. Default: 15,000 milliseconds.
  • reconnectInterval: Time interval (in seconds) after an existing connection is closed and re-opened. A value of -1 disables automatic reconnects. Default: 60 seconds.
  • maxRetries: Number of retries. A value of 0 disables retry attempts. Default: 2.
  • retryDelay: Time (in milliseconds) between retry attempts. Ignored if maxRetries is 0. Default: 3,000 milliseconds.
  • poolSize: Number of concurrent tcp connections (minimum 1). Default: 2.
  • poolMaxWaitTime: Maximum amount of time (in milliseconds) to wait for a connection to become available from the pool. A value of -1 disables the timeout. Default: 5,000 milliseconds.
  • poolMaxIdleTime: Maximum amount of time (in seconds) that a pooled connection can be idle before it is considered 'stale' and will not be reused. A value of -1 disables the max idle time feature. Default: -1 (disabled).

de.siegmar.logbackgelf.GelfTcpTlsAppender

  • Everything from GelfTcpAppender
  • insecure: If true, skip the TLS certificate validation. You should not use this in production! Default: false.

Encoder

de.siegmar.logbackgelf.GelfEncoder

  • originHost: Origin hostname - will be auto detected if not specified.
  • includeRawMessage: If true, the raw message (with argument placeholders) will be sent, too. Default: false.
  • includeMarker: If true, logback markers will be sent, too. Default: true.
  • includeMdcData: If true, MDC keys/values will be sent, too. Default: true.
  • includeCallerData: If true, caller data (source file-, method-, class name and line) will be sent, too. Default: false.
  • includeRootCauseData: If true, root cause exception of the exception passed with the log message will be exposed in the root_cause_class_name and root_cause_message fields. Default: false.
  • includeLevelName: If true, the log level name (e.g. DEBUG) will be sent, too. Default: false.
  • levelNameKey: The key (i.e. the field name) that should be used for the log level name. This is only relevant when includeLevelName is true. Default: level_name.
  • loggerNameKey: The key (i.e. the field name) that should be used for the logger name. Default: logger_name.
  • threadNameKey: The key (i.e. the field name) that should be used for the thread name. Default: thread_name.
  • appendNewline: If true, a system depended newline separator will be added at the end of each message. Don't use this in conjunction with TCP or UDP appenders, as this is only reasonable for console logging!
  • shortPatternLayout: Short message format. Default: "%m%nopex".
  • fullPatternLayout: Full message format (Stacktrace). Default: "%m%n".
  • numbersAsString: Log numbers as String. Default: false.
  • staticFields: Additional, static fields to send to graylog. Defaults: none.

Troubleshooting

If you have any problems, enable the debug mode and check the logs.

<configuration debug="true">
    ...
</configuration>

Copyright

Copyright (C) 2016-2020 Oliver Siegmar

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].