Size: 2543
Comment:
|
Size: 2289
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
{{{WindowsEventLog}}} is part of the CategoryAplTree project. |
|
Line 9: | Line 11: |
The Windows Event Log is important to many large organisation due to the fact that servers situated in a special room cannot be accessed easily, not even by an administrator, and that monitoring them has to be done remotely as a conseqence. The Windows Event Log '''can''' be easily monitored remotely and is therefore the ideal place to report "Start", "Stop", "Fatal Error", Security problems and more. | The Windows Event Log is important to many large organisation due to the fact that servers situated in a special room cannot be accessed easily, not even by an administrator, and that monitoring them has therefore to be done remotely. The Windows Event Log '''can''' be easily monitored remotely and is therefore the ideal place to report "Start", "Stop", "Fatal Error", Security problems and more. |
Line 13: | Line 17: |
There are a number of so-called classes available in the Windows Event Log: | There are a number of so-called "Logs" available in the Windows Event Log: |
Line 17: | Line 21: |
There might be others as well. It is possible to create your own class, although this is '''not''' recommended. | There might be others as well. It is possible to create your own Log. |
Line 19: | Line 23: |
An APL application programmer is likely to want to write into the "Application" class. Therefore, the '''WindowsEventLog''' class defaults to that Window Event Log class. | While security is reserved for Microsoft "System" should be use by drivers etc. "Application" is the natural choice for an APL program, although you might want to create your own log. |
Line 23: | Line 27: |
Note that within a class you must specify a source, normally your application name. Note further that the name of the source must be unqiue '''across all classes''', not only the class you try to write to! Example: there is a source "Server" in the "Application" class on my machine. Although I can create a new class "!MyAppl", I cannot use "Server" as a source name as a consequence! |
Note that within a class you must specify a source, normally your application name. Note further that the name of the source must be unique '''across all logs''', not only the log you try to write to! |
Line 28: | Line 30: |
The '''WindowsEventLog''' class uses .NET but tries to hide everything not needed for an APL application programmer, or to use appropriate defaults. | The '''WindowsEventLog''' class uses .NET but tries to hide everything not needed by an APL application programmer, or to use appropriate defaults. |
Line 31: | Line 33: |
Using this class without Admin rights, for example when your application runs as a service, needs "!EventLogPermission" rigths. On a server you cannot control this might be a problem. Microsoft explicitly points out that granting this right is a security risc and should therefore only be given to code that is fully managed (trusted). | Using this class without admin rights, for example when your application runs as a service, needs "!EventLogPermission" rights. On a server were you cannot control this it might be a problem. Microsoft explicitly points out that granting this right is a security risk and should therefore only be given to code that is fully managed (trusted). |
Line 33: | Line 35: |
== Example == | Normally you get around this by establishing the Source (and possibly also the Log if it is a custom log!) in an installer which needs elevated rights anyway. |
Line 35: | Line 37: |
{{{ my←⎕NEW #.WindowsEventLog(,⊂'MyApp') my.WriteInfo 'Server started' my.WriteWarning 'Low on memory' my.WriteError 'Fatal error, server stopped' my.WriteInfo 'Server started' }}} |
== Project Page == |
Line 43: | Line 39: |
== History == For a full version history: [[WindowsEventLog/History| History]] |
For bug reports, future enhancements and a full version history see WindowsEventLog/ProjectPage |
Line 52: | Line 46: |
||Current state:||1.0|| | |
Line 54: | Line 47: |
== Download == Goto the [[WindowsEventLog/DownloadPage|DownloadPage]] |
<<Include(APLTreeDownloads)>> |
Line 58: | Line 50: |
CategoryOpenSourceApl CategoryAplApl | CategoryAplTree |
Managing the Windows Event Log
WindowsEventLog is part of the CategoryAplTree project.
Contents
Overview
This class offers methods useful to read from and write to the Windows Event Log.
The Windows Event Log is important to many large organisation due to the fact that servers situated in a special room cannot be accessed easily, not even by an administrator, and that monitoring them has therefore to be done remotely.
The Windows Event Log can be easily monitored remotely and is therefore the ideal place to report "Start", "Stop", "Fatal Error", Security problems and more.
Windows Event Log Classes
There are a number of so-called "Logs" available in the Windows Event Log:
There might be others as well. It is possible to create your own Log.
While security is reserved for Microsoft "System" should be use by drivers etc. "Application" is the natural choice for an APL program, although you might want to create your own log.
Source
Note that within a class you must specify a source, normally your application name. Note further that the name of the source must be unique across all logs, not only the log you try to write to!
.NET
The WindowsEventLog class uses .NET but tries to hide everything not needed by an APL application programmer, or to use appropriate defaults.
Security
Using this class without admin rights, for example when your application runs as a service, needs "EventLogPermission" rights. On a server were you cannot control this it might be a problem. Microsoft explicitly points out that granting this right is a security risk and should therefore only be given to code that is fully managed (trusted).
Normally you get around this by establishing the Source (and possibly also the Log if it is a custom log!) in an installer which needs elevated rights anyway.
Project Page
For bug reports, future enhancements and a full version history see WindowsEventLog/ProjectPage
Version Information
Original author: |
|
Responsible: |
|
Email: |