logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy <majikt...@gmail.com>
Subject Re: Cannot set up my custom layout in 2.0 (worked in rc1)
Date Thu, 17 Jul 2014 16:21:41 GMT
+1

I agree packages, or well documented alternative is important for our custom plugins! 


> On Jul 17, 2014, at 8:40 AM, Remko Popma <remko.popma@gmail.com> wrote:
> 
> Matt, can I ask you to raise a Jira for this? It would be good to get the
> packages attribute working again for the 2.0.1 release.
> 
> 
>> On Fri, Jul 18, 2014 at 12:33 AM, Remko Popma <remko.popma@gmail.com> wrote:
>> 
>> But that only works if you use maven to build... The packages attribute
>> always worked regardless of how you build.
>> 
>> 
>>> On Fri, Jul 18, 2014 at 12:31 AM, Matt Sicker <boards@gmail.com> wrote:
>>> 
>>> Yeah because it was only used for runtime loading. Now that log4j-core
>>> contains an annotation processor that automatically creates your plugin
>>> .dat file, there's no need for the packages attribute. It's effectively
>>> impossible to build a plugin without using log4j-core in the classpath, so
>>> it's unnecessary to support the packages attribute. In log4j-core, I had
>>> to
>>> add some special maven-compiler-plugin settings just to get log4j-core to
>>> use an annotation processor from log4j-core, but other projects (e.g., all
>>> the other log4j modules) only need to depend on log4j-core to get loaded
>>> at
>>> runtime.
>>> 
>>> Now if you're using a custom plugin that was built against an older
>>> version
>>> of log4j, it might not have used the processor at the time.
>>> 
>>> 
>>>> On 17 July 2014 10:28, Remko Popma <remko.popma@gmail.com> wrote:
>>>> 
>>>> Packages are ignored?
>>>> 
>>>> 
>>>>> On Fri, Jul 18, 2014 at 12:21 AM, Matt Sicker <boards@gmail.com>
wrote:
>>>>> 
>>>>> The packages attribute is ignored right now. You have to make sure you
>>>>> build your custom plugins using log4j-core in the classpath (which is
>>>> sort
>>>>> of necessary anyways). Also make sure you haven't disabled annotation
>>>>> processing (it's on by default).
>>>>> 
>>>>> 
>>>>>> On 17 July 2014 07:34, Jaime Sastre <jsastre@globalavl.com>
wrote:
>>>>>> 
>>>>>> Yep:
>>>>>> <Configuration packages="com.globalavl.commons.log4j" status="WARN">
>>>>>> 
>>>>>> Package is right and and according to Log4j-config.xsd the xml is
>>> fine
>>>> as
>>>>>> well.
>>>>>> I am debugging some log4j code
>>>>>> 
>>>>>> -----Mensaje original-----
>>>>>> De: Remko Popma [mailto:remko.popma@gmail.com]
>>>>>> Enviado el: jueves, 17 de julio de 2014 13:46
>>>>>> Para: Log4J Users List
>>>>>> Asunto: Re: Cannot set up my custom layout in 2.0 (worked in rc1)
>>>>>> 
>>>>>> Do you have the correct packages="..." attribute specified in the
>>>>>> <Configuration> element?
>>>>>> 
>>>>>> Sent from my iPhone
>>>>>> 
>>>>>>> On 2014/07/17, at 19:08, Jaime Sastre <jsastre@globalavl.com>
>>> wrote:
>>>>>>> 
>>>>>>> Hi,
>>>>>>> Congrats for the release, I been enjoying the progress of it.
>>>>>>> 
>>>>>>> My problema is that I have my layout annotated like this:
>>>>>>> 
>>>>>>> @Plugin(name = "GlobalAVLJSONLayout", category = "Core",
>>> elementType
>>>> =
>>>>>>> "layout", printObject = true) public class GlobalAVLJSONLayout
>>>> extends
>>>>>>> AbstractStringLayout {
>>>>>>> 
>>>>>>> In log4j2.xml:
>>>>>>> 
>>>>>>>                              <RollingRandomAccessFile
>>>>>> name="RollingRandomAccessFile" immediateFlush="false"
>>>>>> fileName="c:/tmp/logs/conf-app.log"
>>> filePattern="conf-logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz">
>>>>>>>                                              <GlobalAVLJSONLayout
>>>>>> source="persistidor" />
>>>>>>>                                              <Policies>
>>>>>> <TimeBasedTriggeringPolicy />
>>>>>> <SizeBasedTriggeringPolicy size="100 MB" />
>>>>>>>                                              </Policies>
>>>> <DefaultRolloverStrategy
>>>>>> max="5" />
>>>>>>>                              </RollingRandomAccessFile>
>>>>>>> 
>>>>>>> It worked with rc1 but with rc2 and 2.0, I am getting this:
>>>>>>> 2014-07-17 12:11:20,768 ERROR RollingRandomAccessFile contains
an
>>>>>> invalid element or attribute "GlobalAVLJSONLayout"
>>>>>>> 
>>>>>>> I am not able to find any related change in release notes.
>>>>>>> Any help?
>>>>>>> Thanks,
>>>>>>> 
>>>>>>> Jaime
>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>>> 
>>>>> 
>>>>> --
>>>>> Matt Sicker <boards@gmail.com>
>>> 
>>> 
>>> 
>>> --
>>> Matt Sicker <boards@gmail.com>
>> 
>> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message