Adam,

How are these properties getting transformed from a logging call to XML?
Are you asking if there's a way to modify a custom format on the fly and
then turn the custom properties into XML?  (I'm thinking of something like
appending name-value pairs to the log format and having a custom appender do
the XML conversion for you.  This doesn't seem terribly elegant.)

Maybe I'm over-trivializing, but it seems to me you should be able to use
custom properties to take care of your current needs, converting your
properties to XML in code, then modifying the ADO appender configuration to
handle that property appropriately when the logging database is implemented.

I guess another question would be what sorts of things need to be
serialized?  Are they going to be serialized from a class?

-Ross

On Mon, Aug 17, 2009 at 8:12 AM, AdamTappis <[email protected]> wrote:

>
> Hi,
>
> I've been evaluating log4net recently with a view to using the framework as
> a loggin standard for our enterprise applicaption. I see it very easy to
> extend the framework, however I have some specific logging requirements and
> I'm not sure what would be the easiest way implement these with minimal
> coding.
>
> At some time in the future, we aim to build a consolidated logging database
> that will capture logging data from our server application suite. The
> information that needs to be logged will differ per service/applicaption
> and
> to that end I would aim to have a table schema that has the standard
> logging
> columns plus a generic XML column (no defined schema) to act as a property
> bag for custom information associated with a specific event.
>
> We don't have time to develop the logging repository at present, however
> I'm
> stressing that we should build logging into our code from the start rather
> than trying to retro-fitting it later which would be far more costly.
>
> So I need my code to be able to fire off logging messages with a list or
> arbitrary custom properties that get formatted into an XML string. For now
> the messages can be written to a text file and later we'll configure and
> AdoNetAppender to write to out logging database.
>
> So my questions are:
> - Is this possible using configuration only? (I susopect not)
> - If not then which custom objects do I need to create? From what I've seen
> so far I think I'll need to code my own Layout Class
> - The ILog interface doesn't doesn't expose a method that takes a property
> bag (or dictionary), but it appears that the LoggingEvent object does. Does
> that mean I would have to make my logging calls using ILog.Logger.Log()?
> - Could someone provide some sample code please?
> --
> View this message in context:
> http://www.nabble.com/Adding-custom-logging-properties-tp25006538p25006538.html
> Sent from the Log4net - Users mailing list archive at Nabble.com.
>
>

Reply via email to