Results 1 to 4 of 4

Thread: Spring + Log4j + Database

  1. #1
    Join Date
    Jul 2007
    Location
    Braga, Portugal
    Posts
    14

    Default Spring + Log4j + Database

    Hi.


    I wanna use log4j for logging in my application but i need to write all logs to a database. The objective is to analyse the performance of my actions (thats another story). I search a lot but all i find is how to write to a file or to the stdout.

    I'm using hibernate, spring and struts2. My application connects to the dabase from a pool configured on the server applications.

    Any idea how to do this? Is possible to implent?

  2. #2
    Join Date
    Dec 2006
    Location
    Jakarta
    Posts
    45

    Default

    you can try to implement Appender interface on org.apache.log4j.Appender to write all the log into database
    Isyak Melton
    Senior IT Consultant

  3. #3
    Join Date
    Feb 2007
    Location
    New Hampshire
    Posts
    54

  4. #4
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    Thanks for the link, that's quite a nice little feature!
    Last edited by karldmoore; Aug 29th, 2007 at 10:21 AM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •