forked from winsw/winsw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Logging subsystem refactoring - use log4net (winsw#145)
* Save the progress * Add log4net Log appender for Windows service events * Get rid of the IEventLogger API, we use log4net now
- Loading branch information
1 parent
2db4fb2
commit 12c16e4
Showing
19 changed files
with
231 additions
and
138 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/Core/ServiceWrapper/Logging/WrapperServiceEventLogProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Text; | ||
using winsw.Logging; | ||
|
||
namespace winsw.Logging | ||
{ | ||
/// <summary> | ||
/// Implements caching of the WindowsService reference in WinSW. | ||
/// </summary> | ||
public class WrapperServiceEventLogProvider : IServiceEventLogProvider | ||
{ | ||
public WrapperService service {get; set;} | ||
|
||
public EventLog locate() | ||
{ | ||
WrapperService _service = service; | ||
if (_service != null && !_service.IsShuttingDown) | ||
{ | ||
return _service.EventLog; | ||
} | ||
|
||
// By default return null | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.