• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

logging and auditing

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

I would like to create a log file in my small web application which registers the following based on users activities like - which user logged in (date n time), which user deleted a record, which user added a record and such.

I do not have a faintest idea how to implement this log file creation. Some googling adivice I found was .....using log4j, some said use filters and listeners, some said use AOP(aspect oriented programming)using Spring Frameworks.

I'm confused.... please help

gotiya
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Log4J is pretty much the "standard" for logging in the Java world - so I'd suggest that - but there are a few special things you have to do to get Log4J working in a J2EE environment.

Filters and listeners will work for detecting when a user logs in or out, and you can use Log4J inside the filter/listener to actually write to the log. It's not going to work for the case when the user adds or deletes a record - this stuff should be handled at a lower level and a filter/listener shouldn't be able to detect this. (You can still use log4j - but in the code that's doing the add/delete of the record, not in a filter/listener.)

I haven't used Spring/AOP, so I can't really help you there...
 
goitya potiya
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nathan,
Your advise has cleared my thoughts, just some more clarifications.
Would I still be able to create a seperate log file for every client that logs into my web application by using log4j
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the Other Open Source Projects forum where tools such as Log4J are discussed.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic