eventlog

T

Tony Johansson

Hi!

I just wonder assume I have an application that for example download files
from a fileserver and
load XML files into a SQL Server 2005 database.

Now I wonder if there are some guidelines how to do this with respect to log
useful things in the event log ?
I have two possibilities here.
1. I can create a custome EventLog for each is these two activities.
or
2. Use the existing application log

//Tony
 
K

Konrad Neitzel

Hi Tony!

I just wonder assume I have an application that for example download
files
from a fileserver and
load XML files into a SQL Server 2005 database.
Now I wonder if there are some guidelines how to do this with respect
to log
useful things in the event log ?
I have two possibilities here.
1. I can create a custome EventLog for each is these two activities.
or
2. Use the existing application log

Hmm ... how much do you want to write? What kind of messages?

We normaly simply use the application log and we onyl put important
stuff in there, that MUST be logged (from our view).

For anything else, that MIGHT be usefull, we simply use a Trace
Listener. Then the administrator can decide what information he wants to
get and where it should be placed (Through the config file).

For example:
- Inside the application log, we write messages like starting / stopping
of services, all errors.
- Inside the trace we write all, that is happening inside the
application.

So far we never had the problem, that we had to write to many messages
to the event log. If you plan to write a lot of messages to the event
log, you should think about writing it inside your own log so you do not
flood the application log.

If you are interested in logging, maybe Log4Net
(http://logging.apache.org/log4net/) could be a nice libary to use.

With kind regards,

Konrad
 
M

Mr. Arnold

Tony said:
Hi!

I just wonder assume I have an application that for example download files
from a fileserver and
load XML files into a SQL Server 2005 database.

Now I wonder if there are some guidelines how to do this with respect to log
useful things in the event log ?
I have two possibilities here.
1. I can create a custome EventLog for each is these two activities.
or
2. Use the existing application log

//Tony

Well, you shouldn't use eventlogs for such a thing. You create a tblLog
in SQL server and log such activities to a tblLog table or a flat text
file appending data into the file.

eventlogs have a capacity limitation, which can be hit pretty fast,
unless one knows how to manage the eventlog data capacity, and what time
frame is used by the O/S to clear the logs or drop entries out of the logs.
 
T

Tony Johansson

Mr. Arnold said:
Well, you shouldn't use eventlogs for such a thing. You create a tblLog in
SQL server and log such activities to a tblLog table or a flat text file
appending data into the file.

eventlogs have a capacity limitation, which can be hit pretty fast, unless
one knows how to manage the eventlog data capacity, and what time frame is
used by the O/S to clear the logs or drop entries out of the logs.

Hi!

What I want to say if when do I create a custom eventlog and when do I use
the existing application log ?
With event logs I mean those that can be view at by the event viewer

//Tony

//Tony
 
M

Mr. Arnold

Tony said:
Hi!

What I want to say if when do I create a custom eventlog and when do I use
the existing application log ?
With event logs I mean those that can be view at by the event viewer

A custom eventlog can be used by your application. But keep in mind,
that an eventlog record is a special record that only has certain fields
on the record to record event information.

You can put your application into a abort condition exception thrown
just on the fact that the custom eventlog is full due to it not being
managed by you properly. That condition would most likely be logged to
the application log by the O/S too.

The custom eventlog should be used by the application to log small
amounts of information like application start datetime, application stop
datetime, and abort conditions etc, etc.


You should not use the eventlog for the situation you're explaining,
send it to a SQL Server table thats for logging that's managed by a
custom application you have written to view and manage the information
in the log table.

Or go use SQL Server Manager to view and manipulate the log table.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top