I don't agree with you that Log4j 2 is worse than Log4j 1. Log4j 2 is a huge improvement.
On Fri, Aug 14, 2015 at 4:05 PM, Xen <x...@dds.nl> wrote: > That is precisely the sort of stuff you get when your application or newer > version is actually worse than your older version, and now you need to do > effort to "persuade" others in joining you when you have not really > improved things ;-). > > I was writing some longer email I guess, I will send it later, I guess. > > Bye. > > Op 14-8-2015 om 10:27 schreef Mikael Ståldal: > > Perhaps the Log4j developers should spend some time to persuade other >> Apache projects to start using Log4j 2. >> >> On Fri, Aug 14, 2015 at 8:05 AM, Jinhong Lu <lujinho...@gmail.com> wrote: >> >> you mean upgrade to log4j2? >>> >>> but all my projects, including spark, hadoop, kafka, they all use >>> log4j1.x >>> >>> 2015-08-14 13:25 GMT+08:00 Ralph Goers <ralph.go...@dslextreme.com>: >>> >>> Please see - >>>> >>>> >>> https://blogs.apache.org/foundation/entry/apache_logging_services_project_announces >>> >>>> < >>>> >>>> >>> https://blogs.apache.org/foundation/entry/apache_logging_services_project_announces >>> >>>> . >>>>> >>>> Ralph >>>> >>>> On Aug 13, 2015, at 10:08 PM, Jinhong Lu <lujinho...@gmail.com> wrote: >>>>> >>>>> I met this exception when using syslogappender. >>>>> >>>>> my log4j version is 1.2.16. >>>>> >>>>> Any idea? thanks. >>>>> >>>>> >>>>> >>>>> >>>>> java.lang.NoSuchFieldError: errorHandler >>>>> at >>>>> >>>> org.apache.log4j.net >>> .SyslogAppender.setSyslogHost(SyslogAppender.java:391) >>> >>>> ~[log4j-1.2.16.jar:na] >>>>> at >>>>> >>>> com.netease.sytopology.util.MySysLogger.<init>(MySysLogger.java:39) >>>> >>>>> ~[stormjar.jar:na] >>>>> at >>>>> >>>> com.netease.sytopology.util.MySysLogger.getInstance(MySysLogger.java:28) >>>> >>>>> ~[stormjar.jar:na] >>>>> at >>>>> >>>> >>> com.netease.sytopology.bolt.FilterFunction.prepare(FilterFunction.java:65) >>> >>>> ~[stormjar.jar:na] >>>>> at >>>>> >>>> >>> storm.trident.planner.processor.EachProcessor.prepare(EachProcessor.java:54) >>> >>>> ~[storm-core-0.9.4.jar:0.9.4] >>>>> at >>>>> >>>> storm.trident.planner.SubtopologyBolt.prepare(SubtopologyBolt.java:121) >>>> >>>>> ~[storm-core-0.9.4.jar:0.9.4] >>>>> at >>>>> >>>> >>> storm.trident.topology.TridentBoltExecutor.prepare(TridentBoltExecutor.java:231) >>> >>>> ~[storm-core-0.9.4.jar:0.9.4] >>>>> at >>>>> >>>> >>>> backtype.storm.daemon.executor$fn__4722$fn__4734.invoke(executor.clj:692) >>>> >>>>> ~[storm-core-0.9.4.jar:0.9.4] >>>>> at backtype.storm.util$async_loop$fn__458.invoke(util.clj:461) >>>>> ~[storm-core-0.9.4.jar:0.9.4] >>>>> at clojure.lang.AFn.run(AFn.java:24) [clojure-1.5.1.jar:na] >>>>> at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67] >>>>> >>>>> >>>>> And here is my code: >>>>> >>>>> >>>>> import org.apache.log4j.Level; >>>>> >>>>> import org.apache.log4j.Logger; >>>>> >>>>> import org.apache.log4j.PatternLayout; >>>>> >>>>> import org.apache.log4j.helpers.OnlyOnceErrorHandler; >>>>> >>>>> import org.apache.log4j.net.SyslogAppender; >>>>> >>>>> import org.apache.log4j.varia.FallbackErrorHandler; >>>>> >>>>> >>>>> public class MySysLogger { >>>>> >>>>> //以下参数均可根据需要放到配置文件中。 >>>>> >>>>> //默认日志级别 >>>>> >>>>> private static Level level = Level.INFO; >>>>> >>>>> //日志接收服务器 >>>>> >>>>> private static String syslogHost = "172.16.1.18"; >>>>> >>>>> //设置facility >>>>> >>>>> private static String facility = "local7"; >>>>> >>>>> private static String loggerName = ""; >>>>> >>>>> >>>>> public static void setLoggerName(String loggerName2) { >>>>> >>>>> MySysLogger.loggerName = loggerName2; >>>>> >>>>> } >>>>> >>>>> >>>>> private static Logger LOG = null; >>>>> >>>>> >>>>> public static synchronized Logger getInstance() { >>>>> >>>>> if (LOG == null) { >>>>> >>>>> new MySysLogger(loggerName); >>>>> >>>>> } >>>>> >>>>> return LOG; >>>>> >>>>> } >>>>> >>>>> >>>>> private MySysLogger(String loggerName) { >>>>> >>>>> >>>>> LOG = Logger.getRootLogger(); >>>>> >>>>> LOG.setLevel(level); >>>>> >>>>> SyslogAppender appender = new SyslogAppender(); >>>>> >>>>> appender.setErrorHandler(new FallbackErrorHandler()); >>>>> >>>>> >>>>> appender.setSyslogHost(syslogHost); >>>>> >>>>> appender.setLayout(new PatternLayout( >>>>> >>>>> "%r " + loggerName +" [%t] %-5p %C%x - %m")); >>>>> >>>>> appender.setHeader(true); >>>>> >>>>> appender.setFacility(facility); >>>>> >>>>> LOG.addAppender(appender); >>>>> >>>>> } >>>>> >>>>> >>>>> } >>>>> >>>> >>>> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > For additional commands, e-mail: log4j-user-h...@logging.apache.org > > -- [image: MagineTV] *Mikael Ståldal* Senior backend developer *Magine TV* mikael.stal...@magine.com Regeringsgatan 25 | 111 53 Stockholm, Sweden | www.magine.com Privileged and/or Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such a person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email.