logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: [Dev][log4j] Log4j 2.x LoggingEvent is not supported
Date Fri, 10 Apr 2015 15:32:19 GMT
This really doesn’t tell me what you are trying to do. Where did you get the LogRecord from
and why do you need the LoggingEvent?  

The class that corresponds to a LoggingEvent is the LogEvent interface which is backed by
the Log4jLogEvent class. As I said, these are internal to Log4j 2 and really shouldn’t be
used directly, so it would be really helpful to know what you are trying to do so we can offer
advice on how to do it.

Ralph

> On Apr 9, 2015, at 9:31 PM, Chathura Priyankara <priyankarahac@gmail.com> wrote:
> 
> Hi Ralph.
> 
> Thank you very much for the response.
> 
> I want to return a logging event from the given log record. So in the application that
I'm trying to upgrade there is an implementation to get log event like follows :
> 
> public static LoggingEvent getLogEvent(LogRecord record) {
>     Priority level = getLogLevel(record.getLevel());
> 
>     return new LoggingEvent(record.getSourceClassName(),
>             Logger.getLogger(record.getSourceClassName()), level,
>             record.getMessage(), record.getThrown());
> }
> 
> So is there anyway that I can make this work ?
> Regards,
> Chathura.
> 
> 
> On Fri, Apr 10, 2015 at 9:51 AM, Ralph Goers <ralph.goers@dslextreme.com <mailto:ralph.goers@dslextreme.com>>
wrote:
> The equivalent of the LoggingEvent is an internal part of the Log4j 2 core. Can you explain
what you are trying to do?
> 
> Ralph
> 
> On Apr 9, 2015, at 8:59 PM, Chathura Priyankara <priyankarahac@gmail.com <mailto:priyankarahac@gmail.com>>
wrote:
> 
>> Hi,
>> 
>> I'm trying to upgrade Log4j 1.2.17 to Log4j 2.2. First I tried to do this using Log4j
1.x bridge as mentioned in [1], but I couldn't find a way to use LoggingEvent with log4j 2.2.

>> In Log4j 2.x LoggingEvent is removed or I'm missing something ?
>> Is there something similar to LoggingEvent in the new version ?
>> 
>> [1] https://logging.apache.org/log4j/2.x/manual/migration.html <https://logging.apache.org/log4j/2.x/manual/migration.html>
>> 
>> Thanks,
>> Best Regards,
>> Chathura.
>> 
>> -- 
>> Chathura Priyankara,
>> Faculty of Information Technology,
>> University of Moratuwa.
>> Blog  : www.codeoncloud.blogspot.com <http://www.codeoncloud.blogspot.com/>
> 
> 
> 
> -- 
> Chathura Priyankara,
> Faculty of Information Technology,
> University of Moratuwa.
> Blog  : www.codeoncloud.blogspot.com <http://www.codeoncloud.blogspot.com/>


Mime
View raw message