Categorygithub.com/ICHx/serialize_log4j_golang
repository
0.0.0-20230317031014-ca6d3abcd191
Repository: https://github.com/ichx/serialize_log4j_golang.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

serialize_log4j_golang

This project to receive log4jEvent from Log4j1.x socketAppender, then convert it as json and forward it, to handle logs generated by legacy Java apps.

Usage

  string `env:"HOST_LOG4J_INPUT" envDefault:"localhost"`
	string `env:"PORT_LOG4J_INPUT" envDefault:"2518"`
  
	string `env:"JSON_LOG_HOST" envDefault:"localhost"`
	string `env:"JSON_LOG_PORT" envDefault:"5540"`

The service read ENV vars on startup, and then create tcp listener on PORT_LOG4J_INPUT. The output tcp socket should be defined on startup, if not reachable will retry for a few times until panicking.

Impl

Split the stream

The problem with my current hacky approach to split the stream is, it can sometimes successfully parsed by sop, while sometimes not.

TODO: