logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <cschneiderpub...@gmail.com>
Subject Re: Custom Log Messages that get forwarded to a database (JPA or JDBC)
Date Sat, 23 Nov 2013 17:08:16 GMT
Hi Jason,
I have read about the JDBC and JPA Appender already. If I understand it
right, the JDBC just forwards "logevents" into a dedicated table. It is not
the case that I can have own log methods (the facade I mentioned) that
forwards into different tables.

Or I missed smth.?

Best regards,
Christian
Am 23.11.2013 02:21 schrieb "Jason B" <makotothedragon@gmail.com>:

> Christian,
>
> As it turns out, Log4j2 has a JDBC appender, which can be configured to
> suit your needs.
>
> You can find more information out about it here:
> https://logging.apache.org/log4j/2.x/manual/appenders.html#JDBCAppender
>
> I've personally not run into a use case where a database-backed appender
> was an ideal solution, but it exists as an option.
>
> ~Jason
>
>
> On Fri, Nov 22, 2013 at 6:13 PM, Christian Schneider <
> cschneiderpublic@gmail.com> wrote:
>
> > Hi, our application runs on several nodes and sometimes there are some
> long
> > running processes.
> > During this processes we collect logs of different types.
> > For example:
> > * Current Env. information (like IP-Address, OS Name, ...)
> > * Urls and their statuscodes,
> > * Erros (Stacktraces) thrown during the process
> > * Some logging of execution times of sub tasks
> > * Some counts of different events
> > * Information about loaded plugins from the classpath
> > and stuff like that.
> >
> > At the end we need to browse through this data (e.g. with a WebUI from a
> > database) to react on the things that may happened during the process.
> >
> > Because the types so different, it would be nice to have an own logging
> > facade. Something like this:
> >
> > interface ProcessLoggingFacade {
> >
> >     public void info(String ipAddress, OS osType, ...);
> >
> >     public void info(Url url, int statuscode);
> >
> >     public void error(String msg, Throwable e);
> >     // ....
> > }
> >
> > The impl. of this facade should parse all calls and store them into
> > different tables of a remote database.
> >
> > Do you think this is a good approach and it is possible with log4j?
> >
> > Thanks,
> >
> > Best Regards,
> > Christian.
> >
>

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