Skip to content

ICHx/serialize_log4j_golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: