Re: Logging complete exception trace.

2015-09-18 Thread Kiran Badi
Yes I am on 2.3.

On Friday, September 18, 2015, Remko Popma  wrote:

> Sorry, I made a mistake: %t prints out the Thread. Please replace %tEx
> with %xEx. Can you show the output of that?
>
> Also, what version of log4j are you using? 2.3?
>
> Sent from my iPhone
>
> > On 2015/09/18, at 23:27, Kiran Badi >
> wrote:
> >
> > Ok here is the pattern changed  I tried
> >
> > %d{dd/MMM/ HH:mm:ss,SSS}- %c{1}: %m%tEx%n
> >
> > After doing this, I got this in logs,
> >
> > 18/Sep/2015 17:23:05,421- myclass: Got the DAO ExceptionError inserting
> > into database. Parameter index out of range (24 > number of parameters,
> > which is 23).http-bio-8084-exec-35Ex
> >
> >
> > All my classes are giving single line exception message,
> >
> > How do I debug this issue now ?
> >
> >
> >
> >
> >
> >> On Fri, Sep 18, 2015 at 2:57 PM, Remko Popma  > wrote:
> >>
> >> Hmm, your source code looks correct. In your config, you could probably
> >> remove the named logger entry.
> > 
> >  
> >  
> >>
> >>
> >> The  alone is sufficient I think.
> >> But this won't solve the issue...
> >>
> >> Do you see this behavior everywhere or only in some places?
> >> If you replace %ex in your pattern with %tEx, location info will be
> added
> >> to the output. This may help pinpoint the code that generates the log
> entry
> >> so you can double check it...
> >>
> >> Sorry I don't have a better answer.
> >>
> >> Remko
> >>
> >> Sent from my iPhone
> >>
> >>> On 2015/09/18, at 20:05, Kiran Badi >
> wrote:
> >>>
> >>> Thanks Remko for reply, I think that's how I do it.
> >>>
> >>> Please see below the way I use it. I am on log4j2 and I have log4j-api,
> >>> log4j-core and log4j-web jars in the lib directory of my web app.
> >>>
> >>> I import these 2 packages
> >>> import org.apache.logging.log4j.LogManager;
> >>> import org.apache.logging.log4j.Logger;
> >>>
> >>>
> >>> Create a static instance
> >>>
> >>> static final Logger log =
> LogManager.getLogger(myclass.class.getName());
> >>>
> >>> then do use it in class file
> >>>
> >>> catch (Exception ex) {
> >>>log.error("Got the exception", ex);
> >>>   }
> >>>
> >>> I was under impression that this should log the complete trace, but its
> >> not.
> >>>
> >>> Any ideas as what I am missing ?
> >>>
> >>>
> >>>
> >>>
>  On Fri, Sep 18, 2015 at 1:49 PM, Remko Popma  >
> >> wrote:
> 
>  In your application,
>  do not use logger.error(exception);
>  but use logger.error("some message", exception); instead.
> 
>  The first form will take the exception object as an object and calls
>  toString() on it, which is not what you want.
> 
>  Remko
> 
>  Sent from my iPhone
> 
> > On 2015/09/18, at 18:00, Kiran Badi  > wrote:
> >
> > Hi All,
> >
> > I have below log42 xml in classes folder and I am on log4j2 . This
>  setting
> > does not log exception and it just logs1 line exception.
> >
> > How do I make log4j2 to log complete exception trace in mysite log ?
> >
> >
> >
> > 
> > 
> > 
> >  
> >   C:/logs/
> > 
> >  
> >  
> >   fileName="${log-path}/mysite.log"
> >
> > filePattern="${log-path}/indianads-%d{-MM-dd}-%i.log">
> >  
> >  %d{dd/MMM/ HH:mm:ss,SSS}- %c{1}:
> > %m%ex%n
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> > 
> 
>  -
>  To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> 
>  For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
> >>
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> 
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
>
>


Re: Logging complete exception trace.

2015-09-18 Thread Remko Popma
Hmm, your source code looks correct. In your config, you could probably remove 
the named logger entry. 
>>> 
>>>   
>>>   


The  alone is sufficient I think. 
But this won't solve the issue...

Do you see this behavior everywhere or only in some places?
If you replace %ex in your pattern with %tEx, location info will be added to 
the output. This may help pinpoint the code that generates the log entry so you 
can double check it...

Sorry I don't have a better answer.

Remko

Sent from my iPhone

> On 2015/09/18, at 20:05, Kiran Badi  wrote:
> 
> Thanks Remko for reply, I think that's how I do it.
> 
> Please see below the way I use it. I am on log4j2 and I have log4j-api,
> log4j-core and log4j-web jars in the lib directory of my web app.
> 
> I import these 2 packages
> import org.apache.logging.log4j.LogManager;
> import org.apache.logging.log4j.Logger;
> 
> 
> Create a static instance
> 
> static final Logger log = LogManager.getLogger(myclass.class.getName());
> 
> then do use it in class file
> 
>  catch (Exception ex) {
> log.error("Got the exception", ex);
>}
> 
> I was under impression that this should log the complete trace, but its not.
> 
> Any ideas as what I am missing ?
> 
> 
> 
> 
>> On Fri, Sep 18, 2015 at 1:49 PM, Remko Popma  wrote:
>> 
>> In your application,
>> do not use logger.error(exception);
>> but use logger.error("some message", exception); instead.
>> 
>> The first form will take the exception object as an object and calls
>> toString() on it, which is not what you want.
>> 
>> Remko
>> 
>> Sent from my iPhone
>> 
>>> On 2015/09/18, at 18:00, Kiran Badi  wrote:
>>> 
>>> Hi All,
>>> 
>>> I have below log42 xml in classes folder and I am on log4j2 . This
>> setting
>>> does not log exception and it just logs1 line exception.
>>> 
>>> How do I make log4j2 to log complete exception trace in mysite log ?
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>   
>>>C:/logs/
>>> 
>>>   
>>>   
>>>   >> 
>>> filePattern="${log-path}/indianads-%d{-MM-dd}-%i.log">
>>>   
>>>   %d{dd/MMM/ HH:mm:ss,SSS}- %c{1}:
>>> %m%ex%n
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>> 
>> 
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>> 
>> 


Re: Logging complete exception trace.

2015-09-18 Thread Remko Popma
Sorry, I made a mistake: %t prints out the Thread. Please replace %tEx with 
%xEx. Can you show the output of that?

Also, what version of log4j are you using? 2.3?

Sent from my iPhone

> On 2015/09/18, at 23:27, Kiran Badi  wrote:
> 
> Ok here is the pattern changed  I tried
> 
> %d{dd/MMM/ HH:mm:ss,SSS}- %c{1}: %m%tEx%n
> 
> After doing this, I got this in logs,
> 
> 18/Sep/2015 17:23:05,421- myclass: Got the DAO ExceptionError inserting
> into database. Parameter index out of range (24 > number of parameters,
> which is 23).http-bio-8084-exec-35Ex
> 
> 
> All my classes are giving single line exception message,
> 
> How do I debug this issue now ?
> 
> 
> 
> 
> 
>> On Fri, Sep 18, 2015 at 2:57 PM, Remko Popma  wrote:
>> 
>> Hmm, your source code looks correct. In your config, you could probably
>> remove the named logger entry.
> 
>  
>  
>> 
>> 
>> The  alone is sufficient I think.
>> But this won't solve the issue...
>> 
>> Do you see this behavior everywhere or only in some places?
>> If you replace %ex in your pattern with %tEx, location info will be added
>> to the output. This may help pinpoint the code that generates the log entry
>> so you can double check it...
>> 
>> Sorry I don't have a better answer.
>> 
>> Remko
>> 
>> Sent from my iPhone
>> 
>>> On 2015/09/18, at 20:05, Kiran Badi  wrote:
>>> 
>>> Thanks Remko for reply, I think that's how I do it.
>>> 
>>> Please see below the way I use it. I am on log4j2 and I have log4j-api,
>>> log4j-core and log4j-web jars in the lib directory of my web app.
>>> 
>>> I import these 2 packages
>>> import org.apache.logging.log4j.LogManager;
>>> import org.apache.logging.log4j.Logger;
>>> 
>>> 
>>> Create a static instance
>>> 
>>> static final Logger log = LogManager.getLogger(myclass.class.getName());
>>> 
>>> then do use it in class file
>>> 
>>> catch (Exception ex) {
>>>log.error("Got the exception", ex);
>>>   }
>>> 
>>> I was under impression that this should log the complete trace, but its
>> not.
>>> 
>>> Any ideas as what I am missing ?
>>> 
>>> 
>>> 
>>> 
 On Fri, Sep 18, 2015 at 1:49 PM, Remko Popma 
>> wrote:
 
 In your application,
 do not use logger.error(exception);
 but use logger.error("some message", exception); instead.
 
 The first form will take the exception object as an object and calls
 toString() on it, which is not what you want.
 
 Remko
 
 Sent from my iPhone
 
> On 2015/09/18, at 18:00, Kiran Badi  wrote:
> 
> Hi All,
> 
> I have below log42 xml in classes folder and I am on log4j2 . This
 setting
> does not log exception and it just logs1 line exception.
> 
> How do I make log4j2 to log complete exception trace in mysite log ?
> 
> 
> 
> 
> 
> 
>  
>   C:/logs/
> 
>  
>  
>   
> filePattern="${log-path}/indianads-%d{-MM-dd}-%i.log">
>  
>  %d{dd/MMM/ HH:mm:ss,SSS}- %c{1}:
> %m%ex%n
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> 
 
 -
 To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org
>> 

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



Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Ralph Goers
Nick,

You ask and discuss on the dev list.  The number of developers isn’t that large 
so it should be readily apparent if there is interest.  That said, Log4j 1.x 
was pretty dormant when I started working on Log4j 2. I worked for almost 18 
months before I committed anything just because I wasn’t really sure about 
anything. After I had something to talk about I committed it to an experimental 
branch where others could start contributing their ideas.  I think that has 
worked out pretty well.

Since you don’t currently have commit rights you might either start something 
on github or it may be possible to create a new git repo for log4net 2 and give 
you access to that. That would be a bit unusual but not unheard of.

Ralph


> On Sep 18, 2015, at 12:12 PM, Nicholas Duane  wrote:
> 
> I'll take a look at the link.  So if I'm interested in helping, if in fact 
> the goal is to port log4j2 to .net, then how do I know whether anyone who 
> would make that decision is even thinking about that, if they are thinking 
> about it how do I know if they've decided to move forward, and when that 
> decision takes place?  Do I just put my name on a "waiting list"?
> 
> Thanks,
> Nick
> 
> Subject: Re: Why is log4net not more similar to log4j(2)?
> From: ralph.go...@dslextreme.com
> Date: Fri, 18 Sep 2015 11:25:40 -0700
> CC: log4net-u...@logging.apache.org
> To: log4j-user@logging.apache.org
> 
> To answer your last question, at the ASF the project committers decide what 
> they are going to do. They make decisions by discussing their ideas on the 
> mailing list.  In some ways, the ASF is a “do-ocracy”. You can make all the 
> recommendations you want, but ultimately it is up to whoever implements it.
> Take a look at http://www.apache.org/foundation/how-it-works.html.
> Ralph
> 
> 
> 
> On Sep 18, 2015, at 7:32 AM, Nicholas Duane  wrote:I looked 
> over the thread you included below.  I can't tell from that whether the 
> suggestion was to port log4j2.  Not sure if the comment about starting 
> log4net 2.0 "from scratch" is an indication of having it be a port of log4j2.
> 
> In my mind the biggest benefit would be to have the same architecture/feature 
> set running on both linux and windows.  Of course it would also be great if 
> the releases were synchronized.  I know a big gripe of log4net is that it's 
> not getting rev'd.
> 
> I would be interested in helping if the goal is to bring log4net in sync with 
> log4j2.  And by this I guess I mean port as that would seem the easiest and 
> safest path to the goal.
> 
> I haven't worked on any open source project in the past.  I'm curious, how 
> does this work?  Who's coordinating and making the decisions?
> 
> Thanks,
> Nick
> 
> From: bode...@apache.org
> To: log4j-user@logging.apache.org; log4net-u...@logging.apache.org
> Subject: Re: Why is log4net not more similar to log4j(2)?
> Date: Fri, 18 Sep 2015 09:25:00 +0200
> 
> On 2015-09-17, Gary Gregory wrote:
> 
> "Patches welcome" is my motto :-)
> 
> Gary
> 
> On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane  wrote:
> 
> Sending to both the log4j and log4net mailing lists.
> 
> I'm curious why log4net is not more similar to log4j(2)?  Is it because
> there is less development work being done on log4net and log4j had
> significant changes in the 2.0 version?
> 
> I think I read somewhere that log4net was a port of log4j 1.
> 
> This is certainly part of the reason.  log4net was started as a port of
> 1.x a long time ago.  The developers (long before I joined) added some
> deviations that look closer to what log4j 2 is doing (XML
> configuration).
> 
> Incidently Dominik started a discussion about log4net 2.0 on the dev
> list[1] and some people expressed interest.  Any hand that can offer
> some help is more than welcome, so please come over and join.
> 
> [1] thread starting with 
> http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E
> 
> Stefan
> 
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
> 
> 



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



Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Stefan Bodewig
On 2015-09-17, Gary Gregory wrote:

> "Patches welcome" is my motto :-)

> Gary

> On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane  wrote:

>> Sending to both the log4j and log4net mailing lists.

>> I'm curious why log4net is not more similar to log4j(2)?  Is it because
>> there is less development work being done on log4net and log4j had
>> significant changes in the 2.0 version?

> I think I read somewhere that log4net was a port of log4j 1.

This is certainly part of the reason.  log4net was started as a port of
1.x a long time ago.  The developers (long before I joined) added some
deviations that look closer to what log4j 2 is doing (XML
configuration).

Incidently Dominik started a discussion about log4net 2.0 on the dev
list[1] and some people expressed interest.  Any hand that can offer
some help is more than welcome, so please come over and join.

[1] thread starting with 
http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E

Stefan

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



Re: Logging complete exception trace.

2015-09-18 Thread Kiran Badi
Thanks Remko for reply, I think that's how I do it.

 Please see below the way I use it. I am on log4j2 and I have log4j-api,
log4j-core and log4j-web jars in the lib directory of my web app.

I import these 2 packages
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;


Create a static instance

 static final Logger log = LogManager.getLogger(myclass.class.getName());

then do use it in class file

  catch (Exception ex) {
 log.error("Got the exception", ex);
}

I was under impression that this should log the complete trace, but its not.

Any ideas as what I am missing ?




On Fri, Sep 18, 2015 at 1:49 PM, Remko Popma  wrote:

> In your application,
> do not use logger.error(exception);
> but use logger.error("some message", exception); instead.
>
> The first form will take the exception object as an object and calls
> toString() on it, which is not what you want.
>
> Remko
>
> Sent from my iPhone
>
> > On 2015/09/18, at 18:00, Kiran Badi  wrote:
> >
> > Hi All,
> >
> > I have below log42 xml in classes folder and I am on log4j2 . This
> setting
> > does not log exception and it just logs1 line exception.
> >
> > How do I make log4j2 to log complete exception trace in mysite log ?
> >
> >
> >
> > 
> > 
> > 
> >
> > C:/logs/
> > 
> >
> >
> > >
> > filePattern="${log-path}/indianads-%d{-MM-dd}-%i.log">
> >
> >%d{dd/MMM/ HH:mm:ss,SSS}- %c{1}:
> > %m%ex%n
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 
>
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>


Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Ralph Goers
To answer your last question, at the ASF the project committers decide what 
they are going to do. They make decisions by discussing their ideas on the 
mailing list.  In some ways, the ASF is a “do-ocracy”. You can make all the 
recommendations you want, but ultimately it is up to whoever implements it.

Take a look at http://www.apache.org/foundation/how-it-works.html 
.

Ralph




> On Sep 18, 2015, at 7:32 AM, Nicholas Duane  wrote:
> 
> I looked over the thread you included below.  I can't tell from that whether 
> the suggestion was to port log4j2.  Not sure if the comment about starting 
> log4net 2.0 "from scratch" is an indication of having it be a port of log4j2.
> 
> In my mind the biggest benefit would be to have the same architecture/feature 
> set running on both linux and windows.  Of course it would also be great if 
> the releases were synchronized.  I know a big gripe of log4net is that it's 
> not getting rev'd.
> 
> I would be interested in helping if the goal is to bring log4net in sync with 
> log4j2.  And by this I guess I mean port as that would seem the easiest and 
> safest path to the goal.
> 
> I haven't worked on any open source project in the past.  I'm curious, how 
> does this work?  Who's coordinating and making the decisions?
> 
> Thanks,
> Nick
> 
>> From: bode...@apache.org
>> To: log4j-user@logging.apache.org; log4net-u...@logging.apache.org
>> Subject: Re: Why is log4net not more similar to log4j(2)?
>> Date: Fri, 18 Sep 2015 09:25:00 +0200
>> 
>> On 2015-09-17, Gary Gregory wrote:
>> 
>>> "Patches welcome" is my motto :-)
>> 
>>> Gary
>> 
>>> On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane  wrote:
>> 
 Sending to both the log4j and log4net mailing lists.
>> 
 I'm curious why log4net is not more similar to log4j(2)?  Is it because
 there is less development work being done on log4net and log4j had
 significant changes in the 2.0 version?
>> 
>>> I think I read somewhere that log4net was a port of log4j 1.
>> 
>> This is certainly part of the reason.  log4net was started as a port of
>> 1.x a long time ago.  The developers (long before I joined) added some
>> deviations that look closer to what log4j 2 is doing (XML
>> configuration).
>> 
>> Incidently Dominik started a discussion about log4net 2.0 on the dev
>> list[1] and some people expressed interest.  Any hand that can offer
>> some help is more than welcome, so please come over and join.
>> 
>> [1] thread starting with 
>> http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E
>> 
>> Stefan
>> 
>> -
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>> 
> 



Re: Logging complete exception trace.

2015-09-18 Thread Remko Popma
In your application, 
do not use logger.error(exception);
but use logger.error("some message", exception); instead. 

The first form will take the exception object as an object and calls toString() 
on it, which is not what you want. 

Remko

Sent from my iPhone

> On 2015/09/18, at 18:00, Kiran Badi  wrote:
> 
> Hi All,
> 
> I have below log42 xml in classes folder and I am on log4j2 . This setting
> does not log exception and it just logs1 line exception.
> 
> How do I make log4j2 to log complete exception trace in mysite log ?
> 
> 
> 
> 
> 
> 
>
> C:/logs/
> 
>
>
> 
> filePattern="${log-path}/indianads-%d{-MM-dd}-%i.log">
>
>%d{dd/MMM/ HH:mm:ss,SSS}- %c{1}:
> %m%ex%n
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 

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



Re: Logging complete exception trace.

2015-09-18 Thread Kiran Badi
Ok Remko, Let me make the changes and come back.

On Fri, Sep 18, 2015 at 2:57 PM, Remko Popma  wrote:

> Hmm, your source code looks correct. In your config, you could probably
> remove the named logger entry.
> >>> 
> >>>   
> >>>   
>
>
> The  alone is sufficient I think.
> But this won't solve the issue...
>
> Do you see this behavior everywhere or only in some places?
> If you replace %ex in your pattern with %tEx, location info will be added
> to the output. This may help pinpoint the code that generates the log entry
> so you can double check it...
>
> Sorry I don't have a better answer.
>
> Remko
>
> Sent from my iPhone
>
> > On 2015/09/18, at 20:05, Kiran Badi  wrote:
> >
> > Thanks Remko for reply, I think that's how I do it.
> >
> > Please see below the way I use it. I am on log4j2 and I have log4j-api,
> > log4j-core and log4j-web jars in the lib directory of my web app.
> >
> > I import these 2 packages
> > import org.apache.logging.log4j.LogManager;
> > import org.apache.logging.log4j.Logger;
> >
> >
> > Create a static instance
> >
> > static final Logger log = LogManager.getLogger(myclass.class.getName());
> >
> > then do use it in class file
> >
> >  catch (Exception ex) {
> > log.error("Got the exception", ex);
> >}
> >
> > I was under impression that this should log the complete trace, but its
> not.
> >
> > Any ideas as what I am missing ?
> >
> >
> >
> >
> >> On Fri, Sep 18, 2015 at 1:49 PM, Remko Popma 
> wrote:
> >>
> >> In your application,
> >> do not use logger.error(exception);
> >> but use logger.error("some message", exception); instead.
> >>
> >> The first form will take the exception object as an object and calls
> >> toString() on it, which is not what you want.
> >>
> >> Remko
> >>
> >> Sent from my iPhone
> >>
> >>> On 2015/09/18, at 18:00, Kiran Badi  wrote:
> >>>
> >>> Hi All,
> >>>
> >>> I have below log42 xml in classes folder and I am on log4j2 . This
> >> setting
> >>> does not log exception and it just logs1 line exception.
> >>>
> >>> How do I make log4j2 to log complete exception trace in mysite log ?
> >>>
> >>>
> >>>
> >>> 
> >>> 
> >>> 
> >>>   
> >>>C:/logs/
> >>> 
> >>>   
> >>>   
> >>>>>>
> >>> filePattern="${log-path}/indianads-%d{-MM-dd}-%i.log">
> >>>   
> >>>   %d{dd/MMM/ HH:mm:ss,SSS}- %c{1}:
> >>> %m%ex%n
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>> 
> >>
> >> -
> >> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> >> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >>
> >>
>


Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Dominik Psenner
See inline..

2015-09-18 21:21 GMT+02:00 Nicholas Duane :

> "So, yes, log4net2 should be based on log4j2 and reuse all the knowledge
> that has been generated within log4j2."
>
> While that sounds like it could mean a port I guess it doesn't necessarily
> mean it is a port.  I guess I'm focusing on "port" because it seems as if
> log4net is an afterthought it will again suffer the same fate.
>

What afterthought? Which fate?


>   I'm thinking that there is an overall architecture and design that is
> platform agnostic and should plan to go to both platforms.
>

That's what I meant with log4net2 should take as much knowledge as possible
from log4j2.


>   As opposed to going to one and then if resources are available it might
> make it to the other, and if it does it might not be that similar.
>

Apologies, it's quite late in my timezone and I seem to be unable to wrap
my head around this sentence. :-) If it means what I interpreted the answer
is:

It has been and will always be something between "what it should be" and
"what gets done". With more time (in the meaning of working time and thus
hours of spare time) there is more room for "what gets done" and thus help
is always welcome. :-) Getting involved further puts you in the position to
decide "what gets done" with even a few more options (the cool one "how it
is done" is among them).

But if the meaning is something else, would you be so kind and rephrase
your point, please?


>
> For instance, I was surprised to see that the level scale is opposite
> between log4j and log4net.  If I was porting I would certainly not have
> thought to reverse the scale.  Well who knows, maybe there was a reason,
> but I can't think of a good reason why that would happen unless log4j2
> reversed it scale from log4j1.
>

This is not entirely true and not at all that dramatic. The scale is
different, yes, but not inversed. Here comes a comparison of a few almost
random samples:

level, log4j, log4net
ALL; -2147483648, -2147483648
DEBUG, 1, 3
INFO, 2, 4
WARN, 3, 6
ERROR, 4, 7
FATAL, 5, 11
OFF, 2147483648, 2147483648

I did not know this, but the log level constants should be the same across
all members of the ASF logging family and therefore I've queued this as
issue LOG4NET-476.

Cheers


> Thanks,
> Nick
>
> --
> Date: Fri, 18 Sep 2015 18:20:46 +0200
> Subject: RE: Why is log4net not more similar to log4j(2)?
> From: dpsen...@gmail.com
> To: log4net-u...@logging.apache.org
> CC: log4j-user@logging.apache.org
>
>
> Given that both c# and java are very similar in both syntax and
> interpreter that runs the bytecode, users of log4j can expect a very steep
> learning curve when starting with log4net. Despite that log4net is based on
> log4j and thus may lack some things found in log4j2. These missing things
> and the support for ancient versions of the .net framework caused my desire
> to start off log4net2.
>
> So, yes, log4net2 should be based on log4j2 and reuse all the knowledge
> that has been generated within log4j2. It would be stupid to do otherwise.
>
> All this can be achieved only with a rewrite. Im no fan of code
> generators, therefore, translating java to c# will be no option to me. In
> the end we would probably have to invest more time in analyzing and
> bugfixing generated code.
>
> The downside of a rewrite is that it is a lot of work and thus it takes
> time. I can invest about an hour a week. Currently this hour goes into
> responding questions on both user and dev mailingist. To make this real a
> lot of helping hands will be required. Volunteers are welcome!
>
> Cheers
> On 18 Sep 2015 4:32 pm, "Nicholas Duane"  wrote:
>
> I looked over the thread you included below.  I can't tell from that
> whether the suggestion was to port log4j2.  Not sure if the comment about
> starting log4net 2.0 "from scratch" is an indication of having it be a port
> of log4j2.
>
> In my mind the biggest benefit would be to have the same
> architecture/feature set running on both linux and windows.  Of course it
> would also be great if the releases were synchronized.  I know a big gripe
> of log4net is that it's not getting rev'd.
>
> I would be interested in helping if the goal is to bring log4net in sync
> with log4j2.  And by this I guess I mean port as that would seem the
> easiest and safest path to the goal.
>
> I haven't worked on any open source project in the past.  I'm curious, how
> does this work?  Who's coordinating and making the decisions?
>
> Thanks,
> Nick
>
> > From: bode...@apache.org
> > To: log4j-user@logging.apache.org; log4net-u...@logging.apache.org
> > Subject: Re: Why is log4net not more similar to log4j(2)?
> > Date: Fri, 18 Sep 2015 09:25:00 +0200
> >
> > On 2015-09-17, Gary Gregory wrote:
> >
> > > "Patches welcome" is my motto :-)
> >
> > > Gary
> >
> > > On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane 
> wrote:
> >
> > >> 

Re: Logging complete exception trace.

2015-09-18 Thread Kiran Badi
Ok here is the pattern changed  I tried

%d{dd/MMM/ HH:mm:ss,SSS}- %c{1}: %m%tEx%n

After doing this, I got this in logs,

18/Sep/2015 17:23:05,421- myclass: Got the DAO ExceptionError inserting
into database. Parameter index out of range (24 > number of parameters,
which is 23).http-bio-8084-exec-35Ex


All my classes are giving single line exception message,

How do I debug this issue now ?





On Fri, Sep 18, 2015 at 2:57 PM, Remko Popma  wrote:

> Hmm, your source code looks correct. In your config, you could probably
> remove the named logger entry.
> >>> 
> >>>   
> >>>   
>
>
> The  alone is sufficient I think.
> But this won't solve the issue...
>
> Do you see this behavior everywhere or only in some places?
> If you replace %ex in your pattern with %tEx, location info will be added
> to the output. This may help pinpoint the code that generates the log entry
> so you can double check it...
>
> Sorry I don't have a better answer.
>
> Remko
>
> Sent from my iPhone
>
> > On 2015/09/18, at 20:05, Kiran Badi  wrote:
> >
> > Thanks Remko for reply, I think that's how I do it.
> >
> > Please see below the way I use it. I am on log4j2 and I have log4j-api,
> > log4j-core and log4j-web jars in the lib directory of my web app.
> >
> > I import these 2 packages
> > import org.apache.logging.log4j.LogManager;
> > import org.apache.logging.log4j.Logger;
> >
> >
> > Create a static instance
> >
> > static final Logger log = LogManager.getLogger(myclass.class.getName());
> >
> > then do use it in class file
> >
> >  catch (Exception ex) {
> > log.error("Got the exception", ex);
> >}
> >
> > I was under impression that this should log the complete trace, but its
> not.
> >
> > Any ideas as what I am missing ?
> >
> >
> >
> >
> >> On Fri, Sep 18, 2015 at 1:49 PM, Remko Popma 
> wrote:
> >>
> >> In your application,
> >> do not use logger.error(exception);
> >> but use logger.error("some message", exception); instead.
> >>
> >> The first form will take the exception object as an object and calls
> >> toString() on it, which is not what you want.
> >>
> >> Remko
> >>
> >> Sent from my iPhone
> >>
> >>> On 2015/09/18, at 18:00, Kiran Badi  wrote:
> >>>
> >>> Hi All,
> >>>
> >>> I have below log42 xml in classes folder and I am on log4j2 . This
> >> setting
> >>> does not log exception and it just logs1 line exception.
> >>>
> >>> How do I make log4j2 to log complete exception trace in mysite log ?
> >>>
> >>>
> >>>
> >>> 
> >>> 
> >>> 
> >>>   
> >>>C:/logs/
> >>> 
> >>>   
> >>>   
> >>>>>>
> >>> filePattern="${log-path}/indianads-%d{-MM-dd}-%i.log">
> >>>   
> >>>   %d{dd/MMM/ HH:mm:ss,SSS}- %c{1}:
> >>> %m%ex%n
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>>   
> >>> 
> >>
> >> -
> >> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> >> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >>
> >>
>


RE: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Nicholas Duane
I looked over the thread you included below.  I can't tell from that whether 
the suggestion was to port log4j2.  Not sure if the comment about starting 
log4net 2.0 "from scratch" is an indication of having it be a port of log4j2.

In my mind the biggest benefit would be to have the same architecture/feature 
set running on both linux and windows.  Of course it would also be great if the 
releases were synchronized.  I know a big gripe of log4net is that it's not 
getting rev'd.

I would be interested in helping if the goal is to bring log4net in sync with 
log4j2.  And by this I guess I mean port as that would seem the easiest and 
safest path to the goal.

I haven't worked on any open source project in the past.  I'm curious, how does 
this work?  Who's coordinating and making the decisions?

Thanks,
Nick

> From: bode...@apache.org
> To: log4j-user@logging.apache.org; log4net-u...@logging.apache.org
> Subject: Re: Why is log4net not more similar to log4j(2)?
> Date: Fri, 18 Sep 2015 09:25:00 +0200
> 
> On 2015-09-17, Gary Gregory wrote:
> 
> > "Patches welcome" is my motto :-)
> 
> > Gary
> 
> > On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane  wrote:
> 
> >> Sending to both the log4j and log4net mailing lists.
> 
> >> I'm curious why log4net is not more similar to log4j(2)?  Is it because
> >> there is less development work being done on log4net and log4j had
> >> significant changes in the 2.0 version?
> 
> > I think I read somewhere that log4net was a port of log4j 1.
> 
> This is certainly part of the reason.  log4net was started as a port of
> 1.x a long time ago.  The developers (long before I joined) added some
> deviations that look closer to what log4j 2 is doing (XML
> configuration).
> 
> Incidently Dominik started a discussion about log4net 2.0 on the dev
> list[1] and some people expressed interest.  Any hand that can offer
> some help is more than welcome, so please come over and join.
> 
> [1] thread starting with 
> http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E
> 
> Stefan
> 
> -
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
  

Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Douglas Wegscheid
is something like jni4net an interim solution? Use log4j2 as is, just
expose the logging methods to .Net? All the guts would still be log4j2.

Yes, a little icky and clunky (and possibly not even viable), but just
throwing it out there

*■ DOUGLAS E. WEGSCHEID* // Lead Analyst, Directories
(269) 923-5278 // douglas_e_wegsch...@whirlpool.com

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

On Fri, Sep 18, 2015 at 12:20 PM, Dominik Psenner 
wrote:

> Given that both c# and java are very similar in both syntax and interpreter
> that runs the bytecode, users of log4j can expect a very steep learning
> curve when starting with log4net. Despite that log4net is based on log4j
> and thus may lack some things found in log4j2. These missing things and the
> support for ancient versions of the .net framework caused my desire to
> start off log4net2.
>
> So, yes, log4net2 should be based on log4j2 and reuse all the knowledge
> that has been generated within log4j2. It would be stupid to do otherwise.
>
> All this can be achieved only with a rewrite. Im no fan of code generators,
> therefore, translating java to c# will be no option to me. In the end we
> would probably have to invest more time in analyzing and bugfixing
> generated code.
>
> The downside of a rewrite is that it is a lot of work and thus it takes
> time. I can invest about an hour a week. Currently this hour goes into
> responding questions on both user and dev mailingist. To make this real a
> lot of helping hands will be required. Volunteers are welcome!
>
> Cheers
> On 18 Sep 2015 4:32 pm, "Nicholas Duane"  wrote:
>
> > I looked over the thread you included below.  I can't tell from that
> > whether the suggestion was to port log4j2.  Not sure if the comment about
> > starting log4net 2.0 "from scratch" is an indication of having it be a
> port
> > of log4j2.
> >
> > In my mind the biggest benefit would be to have the same
> > architecture/feature set running on both linux and windows.  Of course it
> > would also be great if the releases were synchronized.  I know a big
> gripe
> > of log4net is that it's not getting rev'd.
> >
> > I would be interested in helping if the goal is to bring log4net in sync
> > with log4j2.  And by this I guess I mean port as that would seem the
> > easiest and safest path to the goal.
> >
> > I haven't worked on any open source project in the past.  I'm curious,
> how
> > does this work?  Who's coordinating and making the decisions?
> >
> > Thanks,
> > Nick
> >
> > > From: bode...@apache.org
> > > To: log4j-user@logging.apache.org; log4net-u...@logging.apache.org
> > > Subject: Re: Why is log4net not more similar to log4j(2)?
> > > Date: Fri, 18 Sep 2015 09:25:00 +0200
> > >
> > > On 2015-09-17, Gary Gregory wrote:
> > >
> > > > "Patches welcome" is my motto :-)
> > >
> > > > Gary
> > >
> > > > On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane 
> > wrote:
> > >
> > > >> Sending to both the log4j and log4net mailing lists.
> > >
> > > >> I'm curious why log4net is not more similar to log4j(2)? Is it
> because
> > > >> there is less development work being done on log4net and log4j had
> > > >> significant changes in the 2.0 version?
> > >
> > > > I think I read somewhere that log4net was a port of log4j 1.
> > >
> > > This is certainly part of the reason. log4net was started as a port of
> > > 1.x a long time ago. The developers (long before I joined) added some
> > > deviations that look closer to what log4j 2 is doing (XML
> > > configuration).
> > >
> > > Incidently Dominik started a discussion about log4net 2.0 on the dev
> > > list[1] and some people expressed interest. Any hand that can offer
> > > some help is more than welcome, so please come over and join.
> > >
> > > [1] thread starting with
> >
> http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E
> > >
> > > Stefan
> > >
> > > -
> > > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> > > For additional commands, e-mail: log4j-user-h...@logging.apache.org
> > >
> >
>

-- 
*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.*




RE: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Nicholas Duane
I'll take a look at the link.  So if I'm interested in helping, if in fact the 
goal is to port log4j2 to .net, then how do I know whether anyone who would 
make that decision is even thinking about that, if they are thinking about it 
how do I know if they've decided to move forward, and when that decision takes 
place?  Do I just put my name on a "waiting list"?

Thanks,
Nick

Subject: Re: Why is log4net not more similar to log4j(2)?
From: ralph.go...@dslextreme.com
Date: Fri, 18 Sep 2015 11:25:40 -0700
CC: log4net-u...@logging.apache.org
To: log4j-user@logging.apache.org

To answer your last question, at the ASF the project committers decide what 
they are going to do. They make decisions by discussing their ideas on the 
mailing list.  In some ways, the ASF is a “do-ocracy”. You can make all the 
recommendations you want, but ultimately it is up to whoever implements it.
Take a look at http://www.apache.org/foundation/how-it-works.html.
Ralph



On Sep 18, 2015, at 7:32 AM, Nicholas Duane  wrote:I looked 
over the thread you included below.  I can't tell from that whether the 
suggestion was to port log4j2.  Not sure if the comment about starting log4net 
2.0 "from scratch" is an indication of having it be a port of log4j2.

In my mind the biggest benefit would be to have the same architecture/feature 
set running on both linux and windows.  Of course it would also be great if the 
releases were synchronized.  I know a big gripe of log4net is that it's not 
getting rev'd.

I would be interested in helping if the goal is to bring log4net in sync with 
log4j2.  And by this I guess I mean port as that would seem the easiest and 
safest path to the goal.

I haven't worked on any open source project in the past.  I'm curious, how does 
this work?  Who's coordinating and making the decisions?

Thanks,
Nick

From: bode...@apache.org
To: log4j-user@logging.apache.org; log4net-u...@logging.apache.org
Subject: Re: Why is log4net not more similar to log4j(2)?
Date: Fri, 18 Sep 2015 09:25:00 +0200

On 2015-09-17, Gary Gregory wrote:

"Patches welcome" is my motto :-)

Gary

On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane  wrote:

Sending to both the log4j and log4net mailing lists.

I'm curious why log4net is not more similar to log4j(2)?  Is it because
there is less development work being done on log4net and log4j had
significant changes in the 2.0 version?

I think I read somewhere that log4net was a port of log4j 1.

This is certainly part of the reason.  log4net was started as a port of
1.x a long time ago.  The developers (long before I joined) added some
deviations that look closer to what log4j 2 is doing (XML
configuration).

Incidently Dominik started a discussion about log4net 2.0 on the dev
list[1] and some people expressed interest.  Any hand that can offer
some help is more than welcome, so please come over and join.

[1] thread starting with 
http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E

Stefan

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

  
  

RE: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Dominik Psenner
Given that both c# and java are very similar in both syntax and interpreter
that runs the bytecode, users of log4j can expect a very steep learning
curve when starting with log4net. Despite that log4net is based on log4j
and thus may lack some things found in log4j2. These missing things and the
support for ancient versions of the .net framework caused my desire to
start off log4net2.

So, yes, log4net2 should be based on log4j2 and reuse all the knowledge
that has been generated within log4j2. It would be stupid to do otherwise.

All this can be achieved only with a rewrite. Im no fan of code generators,
therefore, translating java to c# will be no option to me. In the end we
would probably have to invest more time in analyzing and bugfixing
generated code.

The downside of a rewrite is that it is a lot of work and thus it takes
time. I can invest about an hour a week. Currently this hour goes into
responding questions on both user and dev mailingist. To make this real a
lot of helping hands will be required. Volunteers are welcome!

Cheers
On 18 Sep 2015 4:32 pm, "Nicholas Duane"  wrote:

> I looked over the thread you included below.  I can't tell from that
> whether the suggestion was to port log4j2.  Not sure if the comment about
> starting log4net 2.0 "from scratch" is an indication of having it be a port
> of log4j2.
>
> In my mind the biggest benefit would be to have the same
> architecture/feature set running on both linux and windows.  Of course it
> would also be great if the releases were synchronized.  I know a big gripe
> of log4net is that it's not getting rev'd.
>
> I would be interested in helping if the goal is to bring log4net in sync
> with log4j2.  And by this I guess I mean port as that would seem the
> easiest and safest path to the goal.
>
> I haven't worked on any open source project in the past.  I'm curious, how
> does this work?  Who's coordinating and making the decisions?
>
> Thanks,
> Nick
>
> > From: bode...@apache.org
> > To: log4j-user@logging.apache.org; log4net-u...@logging.apache.org
> > Subject: Re: Why is log4net not more similar to log4j(2)?
> > Date: Fri, 18 Sep 2015 09:25:00 +0200
> >
> > On 2015-09-17, Gary Gregory wrote:
> >
> > > "Patches welcome" is my motto :-)
> >
> > > Gary
> >
> > > On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane 
> wrote:
> >
> > >> Sending to both the log4j and log4net mailing lists.
> >
> > >> I'm curious why log4net is not more similar to log4j(2)? Is it because
> > >> there is less development work being done on log4net and log4j had
> > >> significant changes in the 2.0 version?
> >
> > > I think I read somewhere that log4net was a port of log4j 1.
> >
> > This is certainly part of the reason. log4net was started as a port of
> > 1.x a long time ago. The developers (long before I joined) added some
> > deviations that look closer to what log4j 2 is doing (XML
> > configuration).
> >
> > Incidently Dominik started a discussion about log4net 2.0 on the dev
> > list[1] and some people expressed interest. Any hand that can offer
> > some help is more than welcome, so please come over and join.
> >
> > [1] thread starting with
> http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E
> >
> > Stefan
> >
> > -
> > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> > For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >
>