Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!goblin1!goblin.stu.neva.ru!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nigel Wade Newsgroups: comp.lang.java.programmer Subject: Re: log4j socket appender Date: Tue, 23 Sep 2014 12:35:34 +0100 Lines: 18 Message-ID: References: <64807899-4e1f-4a12-853b-ad521a27ec48@googlegroups.com> <0b888669-b830-499b-a935-80e1a6900ed3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net DwOEt2ZbpVzq4uqclRtSCgD7Lh8VQYG0A3IZYGTNAVlG7Q2TO9 Cancel-Lock: sha1:+U3/n2Armfww6kheyqXZZeK25Gs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 In-Reply-To: <0b888669-b830-499b-a935-80e1a6900ed3@googlegroups.com> Xref: csiph.com comp.lang.java.programmer:30028 On 22/09/14 16:29, doug.farrell@gmail.com wrote: > Hi all, > > Thanks for the responses, I'm a complete Java novice, so struggling to follow along. However, the JsonLayout provided by the jackson-core JAR seems to apply to creating and reading configuration files in JSON format, not streaming output from a log4j (version 2.*) to a socket appender. Am I mistaken about this? > > Thanks again, > Doug > I've never used the SocketAppender, and from looking at the API docs. I presume you are using log4j version 2, previously it seems as though SocketAppender would only send serialized messages over TCP. What format is your logging server expecting the log messages to be in? If you want a text format try using the same PatternLayout as you do for the ConsoleAppender. -- Nigel Wade