By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,949 Members | 1,563 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,949 IT Pros & Developers. It's quick & easy.

Logging

P: n/a
A.M
Hi,

What would be the best approach to log different items (SQL, Exceptions,
Security, ...)
I have a simple Logging function that adds log string to the end of a text
file.
Is there any application block for that? Should i do the logging into SQL
server table ?

Any help would be apprecited,
Ali
Nov 18 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
I've always preferred using a DB, like MS SQL, to log to. It allows for
easier retrieval later and better reporting.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"A.M" <IH*******@sapm123.com> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
Hi,

What would be the best approach to log different items (SQL, Exceptions,
Security, ...)
I have a simple Logging function that adds log string to the end of a text
file.
Is there any application block for that? Should i do the logging into SQL
server table ?

Any help would be apprecited,
Ali

Nov 18 '05 #2

P: n/a
A.M
Isn't it a heavy load on DB server?

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ut**************@TK2MSFTNGP11.phx.gbl...
I've always preferred using a DB, like MS SQL, to log to. It allows for
easier retrieval later and better reporting.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"A.M" <IH*******@sapm123.com> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
Hi,

What would be the best approach to log different items (SQL, Exceptions,
Security, ...)
I have a simple Logging function that adds log string to the end of a text file.
Is there any application block for that? Should i do the logging into SQL server table ?

Any help would be apprecited,
Ali


Nov 18 '05 #3

P: n/a
Curt_C [MVP] wrote:
I've always preferred using a DB, like MS SQL, to log to. It allows for
easier retrieval later and better reporting.


How do you log a failed login into the database?

--
gabriel
Nov 18 '05 #4

P: n/a
not really, I mean it's better then opening files as the file system level
that's for sure....

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"A.M" <IH*******@sapm123.com> wrote in message
news:eo**************@TK2MSFTNGP11.phx.gbl...
Isn't it a heavy load on DB server?

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:ut**************@TK2MSFTNGP11.phx.gbl...
I've always preferred using a DB, like MS SQL, to log to. It allows for
easier retrieval later and better reporting.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"A.M" <IH*******@sapm123.com> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
Hi,

What would be the best approach to log different items (SQL, Exceptions, Security, ...)
I have a simple Logging function that adds log string to the end of a text file.
Is there any application block for that? Should i do the logging into SQL server table ?

Any help would be apprecited,
Ali



Nov 18 '05 #5

P: n/a
I have a seperate user that runs all "non-user specific" items, like
logging.

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"gabriel" <no@no--spam.com> wrote in message
news:1e***************************@msgid.meganewss ervers.com...
Curt_C [MVP] wrote:
I've always preferred using a DB, like MS SQL, to log to. It allows for
easier retrieval later and better reporting.


How do you log a failed login into the database?

--
gabriel

Nov 18 '05 #6

P: n/a
I use sqlserver, and a background thread to do the logging, this way logging
does not hold up processing. if the logging thread cannot write to
sqlserver, it logs to the event log.

-- bruce (sqlwork.com)


"A.M" <IH*******@sapm123.com> wrote in message
news:O#**************@tk2msftngp13.phx.gbl...
Hi,

What would be the best approach to log different items (SQL, Exceptions,
Security, ...)
I have a simple Logging function that adds log string to the end of a text
file.
Is there any application block for that? Should i do the logging into SQL
server table ?

Any help would be apprecited,
Ali

Nov 18 '05 #7

P: n/a
There are many places you can log your errors. My prefrence is to use the windows event logs
You can also have your own text file logging. It can be plain text or an XML file
As Curt mentioned SQL is also another alternative and it is also the easiest to report from if you have a need for that kind of stuff

Each of the above methods has their ups and downs

Logging to the event logs>> Web users have to given rights to write to this log and sys admins sometimes wont like this
Logging to your own text file>> Slower than logging to SQL or Event logs. You have manage the file on your own(i.e. how much can it grow, etc
Logging to SQL server>> Logging credentials might fail

It's up to you to figure out what best fits your application and design the best solution

BTW when you are logging errors to the database it would be better to use different credentials to write to the SQL tables other than the credentials used to access your transactional system. Even that's not fail proof so you have to handle a scenario where the credentials fail

A good place to start might be to look at Microsoft's exception management block
http://msdn.microsoft.com/library/de...tml/emab-rm.as

HTH
Suresh

----- gabriel wrote: ----

Curt_C [MVP] wrote
I've always preferred using a DB, like MS SQL, to log to. It allows fo
easier retrieval later and better reporting


How do you log a failed login into the database

--
gabrie

Nov 18 '05 #8

P: n/a
Hi Ali,
Thanks for posting here. As for the datasource to store logging info, I
think Curt and bruce's suggestions are quite considerable. In addition, I'm
not sure whether you've used the "Log4Net" component, it is a tool to help
the programmer output log statements to a variety of output targets.
log4net is a port of the excellent log4j framework to the .NET runtime. Its
multi-Adaptors have provide the support to many targets such as database
server, xml log files and event log.. etc. You'may get its info via the
following web link:

#log4net - Features
http://log4net.sourceforge.net/relea.../features.html

Hope this also helps.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.