You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Nicko Cadell <ni...@neoworks.com> on 2006/07/09 01:18:13 UTC

RE: NDC and MDC fields logged as (null)

 

> -----Original Message-----
> From: tinhuty he [mailto:tinhuty@hotmail.com] 
> Sent: 16 June 2006 15:44
> To: log4net-user@logging.apache.org
> Subject: Re: NDC and MDC fields logged as (null)
> 
> NULL would be ok. But right now it is not.
> 
> I am inserting log to MS SQL database, the value is a string 
> "(null)", ideally it should be NULL value for database.

How are you inserting the value into the database? Are you using the
AdoNetAppender?
Are you using the PatternLayout to extract the value? It is the
NdcPatternConverter that is generating the NULL text.

You can either write a custom layout that generates the required
rendering for your requirements, or you can change the NullText from
(null) to NULL. To set the NullText set the log4net.NullText
<appSetting> in the application's .config file.

Cheers,
Nicko


 
> = = = Original message = = =
> 
> What should the value of the empty NDC be? null seems like an 
> ok canidate doesn't it?
> 
> --- Ken Chu <ke...@yahoo.com> wrote:
> 
> >I was wondering why the value is null at all.? Shouldn't the 
> NDC have a 
> >value?
> >
> >-Ken
> >
> >--- Ron Grabowski <ro...@yahoo.com> wrote:
> >
> > > The default string value for null items is "(null)". The default
> >string
> > > value for items that are not available is "NOT AVAILABLE". These
> >can be
> > > changed by setting the log4net.NullText and
> >log4net.NotAvailableText
> > > appSettings keys.
> > > > --- Ken Chu <ke...@yahoo.com> wrote:
> > > > > I'm seeing the same problem with the same version running on 
> > > > > .Net
> > > > 2.0.? Anyone
> > > > else seeing this problem?? Is this a known bug?
> > > > > > -Ken
> > > > > > --- tinhuty he <ti...@hotmail.com> wrote:
> > > > > > > I am using the 1.2.10. The NDC and MDC fields are 
> logged in
> >file as
> > > > (null) > > > if they are no value. Are they supposed to 
> just log 
> > > > empty
> >string if
> > > > there > > > are no values?
> > > > > > > > Thanks.
> > > > > > > > 
> __________________________________________________________
> > > > > > > > _
> > > > > Sent by ePrompter, the premier email notification software.
> > > > > Free download at http://www.ePrompter.com.
> > > > > > > >
> >_________________________________________________________________
> > > > > Express yourself instantly with MSN Messenger! 
> Download today -
> > > > it's FREE! > > >
> >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> > > > > > > > > > > > > >
> >
> >
> 
> ___________________________________________________________
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
> 
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search! 
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
> 
> 
>