logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <mattsic...@apache.org>
Subject Fwd: How to store custom-message variable values to the database table's column using log4j2
Date Tue, 10 Oct 2017 14:06:20 GMT
---------- Forwarded message ----------
From: Gaurav Deshpande <Gaurav.Deshpande@1eq.com>
Date: 10 October 2017 at 09:02
Subject: How to store custom-message variable values to the database
table's column using log4j2
To: "mattsicker@apache.org" <mattsicker@apache.org>, "rgoers@apache.org" <
rgoers@apache.org>


Hi Matt/Ralph,



I've created custom-message implementing log4j2's 'message' interface like
following tutorial

https://logging.apache.org/log4j/2.x/manual/messages.html



I've also defined JDBCAppender in lo4j2.xml which writes values from above
message to database table.

I've tried using conversion-pattern %m in the Column configuration but it
stores the whole message.



*Which conversion-pattern to use here to get specific variable values and
writing them in the table's column*?



Link to Stackoverflow question: https://stackoverflow.com/
questions/46668645/store-custom-message-variable-
values-to-the-database-tables-column-using-log4j2



Thanks & Regards,

*Gaurav Deshpande*|*Software Engineer*|

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message