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

Best practice for threadsafe logging

P: n/a
Hi,

Is there any best practice guidelines or examples for threadsafe logging? I
have to write an auditlogging class for a website. The auditlog will be
stored in files on the local filesystem. A new file file is created by the
interval of 24 hours.

/m
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"martin" <ma****@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com...
Hi,

Is there any best practice guidelines or examples for threadsafe logging?
I
have to write an auditlogging class for a website. The auditlog will be
stored in files on the local filesystem. A new file file is created by the
interval of 24 hours.


You can't use the Windows event log?

John Saunders
Jul 21 '05 #2

P: n/a
No, I don't want to log events, I need a complete auditlog.

"John Saunders" wrote:
"martin" <ma****@discussions.microsoft.com> wrote in message
news:3B**********************************@microsof t.com...
Hi,

Is there any best practice guidelines or examples for threadsafe logging?
I
have to write an auditlogging class for a website. The auditlog will be
stored in files on the local filesystem. A new file file is created by the
interval of 24 hours.


You can't use the Windows event log?

John Saunders

Jul 21 '05 #3

P: n/a
"martin" <ma****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
No, I don't want to log events, I need a complete auditlog.


Ok, though I presume you're aware that it's possible to create custom event
logs, so that your audit entries would be the only thing in your custom log.

Otherwise, perhaps you should consider a database.

I don't think you're going to find a single best practice on this,
especially since you haven't been very specific about your requirements.
John Saunders
Jul 21 '05 #4

P: n/a
As I wrote in my first question the auditlog must be stored in files on the
local filesystem. I need a thread safe way to write to a file from a website.
Quite simple question I think. I can read in the SDK how to write to a file
thread safe, but I'm lokking for best practice and/or design guidelines for
the best implementation.

/m

"John Saunders" wrote:
"martin" <ma****@discussions.microsoft.com> wrote in message
news:E1**********************************@microsof t.com...
No, I don't want to log events, I need a complete auditlog.


Ok, though I presume you're aware that it's possible to create custom event
logs, so that your audit entries would be the only thing in your custom log.

Otherwise, perhaps you should consider a database.

I don't think you're going to find a single best practice on this,
especially since you haven't been very specific about your requirements.
John Saunders

Jul 21 '05 #5

P: n/a
"martin" <ma****@discussions.microsoft.com> wrote in message
news:74**********************************@microsof t.com...
As I wrote in my first question the auditlog must be stored in files on
the
local filesystem. I need a thread safe way to write to a file from a
website.
Quite simple question I think. I can read in the SDK how to write to a
file
thread safe, but I'm lokking for best practice and/or design guidelines
for
the best implementation.


See, this is what I'm getting at. There's nothing inherently different about
writing to a file with respect to thread-safety. The same techniques you'd
use for doing anything in a thread-safe manner apply to writing to a file.

John Saunders
Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.