Alex Rivera | Logout

What is a the 'best practice' for location of windows service logfiles?

Asked 2009-01-29T15:26:11.307
9

A lot of windows services write daily log files to their application installation directory under "program files".

Windows system apps (eg IIS) use %SystemRoot%\System32\LogFiles. Is something I should do for my service?

Edit
Report

2 Answers

5

We make the log directory configurable. Depending on usage you may not want logs on the OS drive, or in a location that requires granting rights to more than you need to.

The Event log isn't always the best solution for more verbose logging. We use the event log for error and warning and major state changes (start/stop/etc.) but we use the logfile for more verbose actions.

answered 2009-01-29T17:19:51.107
3

I would suggest neither, these two typically break in Vista (and XP but not as often) as they require admin privileges to write to. Rather I would suggest %AllUsersProfile%\application data\yourService\

answered 2009-01-29T15:42:44.797

Your Answer