Hi Kishanthan, Does this mean, log4j.properties file is no longer supported in 2.0?
Log4j 2.x doesn't support log4j.properties files anymore. We can configure log4j2 using a configuration file written in XML, JSON or YAML or else we can configure log4j2 programmetically [1]. What kind of modifications? Do we have API changes for Appenders as well? There are API changes. Mainly Appenders are declared as Plugins in log4j2. There are some annotations we need to use like @Plugin, @PluginFactory etc. Appenders must also declare a PluginFactory method that will create the appender [2]. With the native upgrade, can other logging API's (SLF4j, JavaUtil, etc) be plugged in easily? Yes we can easily plugin loging APIs such as SLF4j, Commons, JUL. We can use Log4j 2 SLF4J binding [3] to SLF4J API to use Log4j 2 as the implementation. Commons Logging Bridge [4] allows applications coded to the Commons Logging API to use Log4j 2 as the implementation. JUL Adaper (JDK Logging Adapter) [5] can be used as a bridge between Java util logging and log4j. [1]http://logging.apache.org/log4j/2.x/manual/configuration.html [2]http://logging.apache.org/log4j/2.x/manual/extending.html#Appenders [3]https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html [4]https://logging.apache.org/log4j/2.x/log4j-jcl/index.html [5]https://logging.apache.org/log4j/2.x/log4j-jul/index.html Thanks! Best Regards, Chathura. On Mon, Apr 27, 2015 at 11:30 PM, Kishanthan Thangarajah < [email protected]> wrote: > Hi Chathura, > > > On Mon, Apr 20, 2015 at 9:27 AM, Chathura Priyankara <[email protected]> > wrote: > >> Hi Kasun, >> >> Related to the Log4j upgrade in the Carbon platform there are following >> pros and cons of each method. >> >> 1. Using Log4j 1.2 bridge. >> >> Simplest way of converting log4j is to use the Log4j 1.2 bridge, but >> there are some limitations >> with this approach. >> >> Pros >> - Easy to upgrade need only to replace log4j 1.2 jar file with >> log4j-1.2-api.jar >> - Can use existing configuration. >> >> Cons >> - Cannot access methods of some classes such as Appenders. >> - Cannot programmatically configure Log4j >> - Cannot access create Logging events as it is internal to the Log4j core. >> >> 2. Native upgrade >> >> If we do a native upgrade we have to do some changes specially for the >> appenders and configurations. >> >> Pros >> - Support Appeners >> - log4j2 API and implementation is seperated. >> >> Cons >> - Need to convert all log4j configuratoins to XML >> > > Does this mean, log4j.properties file is no longer supported in 2.0? > > >> - Need to do modifications for all Appenders. >> > > What kind of modifications? Do we have API changes for Appenders as well? > > Also a general question. > With the native upgrade, can other logging API's (SLF4j, JavaUtil, etc) be > plugged in easily? > > >> Thanks. >> >> On Sun, Apr 19, 2015 at 12:28 PM, Kasun Gajasinghe <[email protected]> >> wrote: >> >>> Hi Chathura, >>> >>> Can you also list down the pros and cons of each option? >>> >>> Thanks >>> >>> On Apr 16, 2015, at 2:59 PM, Sameera Jayasoma <[email protected]> wrote: >>> >>> Hi Chathura, >>> >>> Lets do a native upgrade. >>> >>> Thanks, >>> Sameera. >>> >>> On Thu, Apr 16, 2015 at 12:38 PM, Chathura Priyankara < >>> [email protected]> wrote: >>> >>>> I'm currently working on migrating the Carbon platform to log4j 2.2 >>>> from 1.2.17. >>>> There are two ways of upgrading log4j version as follows. >>>> >>>> 1. Using the Log4j 1.2 bridge. >>>> 2. Native upgrade >>>> >>>> With the first option we cannot use Appenders. >>>> As we need Appender support I decided to select the second option. >>>> >>>> Appreciate any feedback about this approach. >>>> >>>> Thanks! >>>> Chathura. >>>> >>>> -- >>>> Chathura Priyankara >>>> Software Engineer | WSO2 Inc. >>>> Mobile : +94718795340 >>>> Blog : www.codeoncloud.blogspot.com >>>> >>> >>> >>> >>> -- >>> Sameera Jayasoma, >>> Software Architect, >>> >>> WSO2, Inc. (http://wso2.com) >>> email: [email protected] >>> blog: http://blog.sameera.org >>> twitter: https://twitter.com/sameerajayasoma >>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections >>> Mobile: 0094776364456 >>> >>> Lean . Enterprise . Middleware >>> >>> >> >> >> -- >> Chathura Priyankara >> Software Engineer | WSO2 Inc. >> Mobile : +94718795340 >> Blog : www.codeoncloud.blogspot.com >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > *Kishanthan Thangarajah* > Associate Technical Lead, > Platform Technologies Team, > WSO2, Inc. > lean.enterprise.middleware > > Mobile - +94773426635 > Blog - *http://kishanthan.wordpress.com <http://kishanthan.wordpress.com>* > Twitter - *http://twitter.com/kishanthan <http://twitter.com/kishanthan>* > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- Chathura Priyankara Software Engineer | WSO2 Inc. Mobile : +94718795340 Blog : www.codeoncloud.blogspot.com
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
