• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j logging to database

 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Good Day..

I am trying out some example regarding logging in the database from JDBCAppender of Log4J from the book that I am reading but can't seem to make it work.

Here is the code where the book tried extending the JDBCAppender



...and here's my modified properties file



From what I am seeing, it was able to instantiate the class CustomJDBCAppender because the constructor was called but the overriden method was not called...

I would really appreciate all your pointers. Thanks.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your CustomJDBCAppender class doesn't seem to have a "package" declaration. Add the following package declaration to that class:
 
Mark Reyes
Ranch Hand
Posts: 426
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Sorry..I forgot to include that when I copied the definition of my class but my class is package accordingly.



But still the overriden execute method was not executed accordingly. Maybe I am missing something that I need to place in the code, Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic