which is the reason that projects aren't 'complying'?

   - v2 is not better than v1
   - the upgrade path and bridge jars mean the upgrading is really not
   necessary.

I suspect it's the 2nd: why put a bunch of work into reworking all the
logging in my library (and forcing my users to change their logging
framework, which may not support other dependencies my project has) when I
can spend that effort into making my library do what it does better?

with the way things are, I can use old libraries that use j.u.l, log4j1,
slf4j, or jcl with log4j2 (or slf4j), just need to use the bridge
utilities. I'm to the point when I start a new project that I always start
with a slf4j or log4j2 configuration (and I still write my stuff against
the slf4j APIs), write a method to set up any bridging, and call that
method first thing....


*■ DOUGLAS E. WEGSCHEID* // Lead Analyst, Directories
(269) 923-5278 // [email protected]

"A wrong note played hesitatingly is a wrong note. A wrong note played with
conviction is interpretation."

On Fri, Aug 14, 2015 at 12:15 PM, Xen <[email protected]> wrote:

> Then why do you need to persuade people? Why are they unwilling? Obviously
> they stand to lose something or they would 'comply' of their own.
>
> ;-). Seriously, that's just the case. Your personal opinion doesn't matter
> much it is about what it does to people.
>
> Op 14-8-2015 om 16:19 schreef Mikael Ståldal:
>
> 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 <[email protected]> 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 <[email protected]>
>>>> 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 <[email protected]>:
>>>>>
>>>>> 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 <[email protected]>
>>>>>> 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: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

-- 
*NOTICE: Whirlpool Corporation e-mail is for the designated recipient only 
and may contain proprietary or otherwise confidential information. If you 
have received this e-mail in error, please notify the sender immediately 
and delete the original. Any other use or disclosure of the e-mail by you 
is unauthorized.*


Reply via email to