Solved

logging on ejb/jsp/servlet application

Posted on 2002-05-15
3
166 Views
Last Modified: 2013-11-24
I was wondering if logging to a file on this type of application is ok.  Would it be better to log on a database instead especially if it holds personal data of the customer.

Thanks
0
Comment
Question by:borg48
  • 2
3 Comments
 
LVL 1

Expert Comment

by:mraible
ID: 7015411
I'd recommend using Log4j from jakarta.apache.org - you can do JDBC or file logging.  Logging to a file or a database is up to you - since they'll both (most likely) be on the same server as your app server, it depends on how you want to protect the different logging stores.  With a file, you can protect with file permissions, with a database, you can use database access permissions.
0
 

Author Comment

by:borg48
ID: 7022273
Is there a benefit from logging to a database ver file.  Performance for example?

Thanks
0
 
LVL 1

Accepted Solution

by:
mraible earned 50 total points
ID: 7022303
File pros:
-- faster performance
-- easy configuration/setup

File cons:
-- security not as robust (file permissions)
-- difficult to keep and maintain historic log

DB pros:
-- security (built-in database security)
-- easy to create reports from log tables

DB cons:
-- more difficult to setup
-- probably slower than file logging

You might alleviate performance issues is you use a MySQL database for logging.  It's VERY fast - no referential integrity though.  You may not need RI if you're just using it for logging though.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question