@logtape/windows-eventlog 1.4.0-dev.465 → 1.4.0-dev.468
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -7
- package/dist/mod.d.cts +1 -1
- package/package.json +2 -2
- package/dist/dist/sink.node.d.cts +0 -34
- package/dist/dist/sink.node.d.cts.map +0 -1
- package/dist/dist/types.d.cts +0 -60
- package/dist/dist/types.d.cts.map +0 -1
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@ Windows Event Log sink for [LogTape]. This package provides a Windows Event Log
|
|
|
10
10
|
sink that sends log messages directly to the Windows Event Log system with
|
|
11
11
|
cross-runtime support and optimal performance.
|
|
12
12
|
|
|
13
|
-
[JSR]: https://jsr.io/@logtape/windows-eventlog
|
|
14
13
|
[JSR badge]: https://jsr.io/badges/@logtape/windows-eventlog
|
|
15
|
-
[
|
|
14
|
+
[JSR]: https://jsr.io/@logtape/windows-eventlog
|
|
16
15
|
[npm badge]: https://img.shields.io/npm/v/@logtape/windows-eventlog?logo=npm
|
|
16
|
+
[npm]: https://www.npmjs.com/package/@logtape/windows-eventlog
|
|
17
17
|
[LogTape]: https://logtape.org/
|
|
18
18
|
|
|
19
19
|
|
|
@@ -102,8 +102,9 @@ await configure({
|
|
|
102
102
|
|
|
103
103
|
> [!NOTE]
|
|
104
104
|
> The event ID is used to lookup a string resource from a dynamic link library.
|
|
105
|
-
> If you do not register a library, “the system cannot open the file” will
|
|
106
|
-
> printed as description in the Event Log regardless of the parameters
|
|
105
|
+
> If you do not register a library, “the system cannot open the file” will
|
|
106
|
+
> be printed as description in the Event Log regardless of the parameters
|
|
107
|
+
> passed.
|
|
107
108
|
|
|
108
109
|
If you want to log only the text supplied by the formatter into the event log,
|
|
109
110
|
you can register the system generic string library using this command:
|
|
@@ -146,11 +147,14 @@ The Windows Event Log sink works across multiple JavaScript runtimes on Windows:
|
|
|
146
147
|
Viewing logs
|
|
147
148
|
------------
|
|
148
149
|
|
|
149
|
-
Once your application writes to the Windows Event Log, you can view the logs
|
|
150
|
+
Once your application writes to the Windows Event Log, you can view the logs
|
|
151
|
+
using:
|
|
150
152
|
|
|
151
153
|
- *Event Viewer* (*eventvwr.msc*)
|
|
152
|
-
- *PowerShell*:
|
|
153
|
-
-
|
|
154
|
+
- *PowerShell*:
|
|
155
|
+
`Get-WinEvent -FilterHashtable @{LogName='Application'; ProviderName='MyApplication'}`
|
|
156
|
+
- *Command Prompt*:
|
|
157
|
+
`wevtutil qe Application /f:text /q:"*[System[Provider[@Name='MyApplication']]]"`
|
|
154
158
|
|
|
155
159
|
|
|
156
160
|
Docs
|
package/dist/mod.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { getWindowsEventLogSink } from "./dist/sink.node.cjs";
|
|
2
1
|
import { WindowsEventLogError, WindowsEventLogSinkOptions, WindowsPlatformError } from "./types.cjs";
|
|
2
|
+
import { getWindowsEventLogSink } from "#wineventlog";
|
|
3
3
|
export { WindowsEventLogError, WindowsEventLogSinkOptions, WindowsPlatformError, getWindowsEventLogSink };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logtape/windows-eventlog",
|
|
3
|
-
"version": "1.4.0-dev.
|
|
3
|
+
"version": "1.4.0-dev.468+3b71b201",
|
|
4
4
|
"description": "Windows Event Log sink for LogTape",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"dist/"
|
|
58
58
|
],
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@logtape/logtape": "^1.4.0-dev.
|
|
60
|
+
"@logtape/logtape": "^1.4.0-dev.468+3b71b201"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"koffi": "^2.10.0"
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { WindowsEventLogSinkOptions } from "./types.cjs";
|
|
2
|
-
import { Sink } from "@logtape/logtape";
|
|
3
|
-
|
|
4
|
-
//#region dist/sink.node.d.ts
|
|
5
|
-
|
|
6
|
-
//#region src/sink.node.d.ts
|
|
7
|
-
/**
|
|
8
|
-
* Creates a Windows Event Log sink for Node.js environments using FFI.
|
|
9
|
-
*
|
|
10
|
-
* This implementation uses koffi to call Windows Event Log API directly,
|
|
11
|
-
* providing high performance logging without external dependencies.
|
|
12
|
-
*
|
|
13
|
-
* @param options Configuration options for the sink
|
|
14
|
-
* @returns A LogTape sink that writes to Windows Event Log
|
|
15
|
-
* @throws {WindowsPlatformError} If not running on Windows
|
|
16
|
-
* @throws {WindowsEventLogError} If Event Log operations fail
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* import { getWindowsEventLogSink } from "@logtape/windows-eventlog";
|
|
21
|
-
*
|
|
22
|
-
* const sink = getWindowsEventLogSink({
|
|
23
|
-
* sourceName: "MyApp"
|
|
24
|
-
* });
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @since 1.0.0
|
|
28
|
-
*/
|
|
29
|
-
declare function getWindowsEventLogSink(options: WindowsEventLogSinkOptions): Sink & Disposable;
|
|
30
|
-
//# sourceMappingURL=sink.node.d.ts.map
|
|
31
|
-
//#endregion
|
|
32
|
-
//#endregion
|
|
33
|
-
export { getWindowsEventLogSink };
|
|
34
|
-
//# sourceMappingURL=sink.node.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sink.node.d.cts","names":["WindowsEventLogSinkOptions","Sink","getWindowsEventLogSink","Disposable"],"sources":["../sink.node.d.ts"],"sourcesContent":["import { WindowsEventLogSinkOptions } from \"./types.js\";\nimport { Sink } from \"@logtape/logtape\";\n\n//#region src/sink.node.d.ts\n\n/**\n * Creates a Windows Event Log sink for Node.js environments using FFI.\n *\n * This implementation uses koffi to call Windows Event Log API directly,\n * providing high performance logging without external dependencies.\n *\n * @param options Configuration options for the sink\n * @returns A LogTape sink that writes to Windows Event Log\n * @throws {WindowsPlatformError} If not running on Windows\n * @throws {WindowsEventLogError} If Event Log operations fail\n *\n * @example\n * ```typescript\n * import { getWindowsEventLogSink } from \"@logtape/windows-eventlog\";\n *\n * const sink = getWindowsEventLogSink({\n * sourceName: \"MyApp\"\n * });\n * ```\n *\n * @since 1.0.0\n */\ndeclare function getWindowsEventLogSink(options: WindowsEventLogSinkOptions): Sink & Disposable;\n//# sourceMappingURL=sink.node.d.ts.map\n//#endregion\nexport { getWindowsEventLogSink };\n//# sourceMappingURL=sink.node.d.ts.map"],"mappings":";;;;;;;;;;AA2B+F;;;;;;;;;;;;;;;;;;iBAA9EE,sBAAAA,UAAgCF,6BAA6BC,OAAOE"}
|
package/dist/dist/types.d.cts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { LogLevel, TextFormatter } from "@logtape/logtape";
|
|
2
|
-
|
|
3
|
-
//#region dist/types.d.ts
|
|
4
|
-
|
|
5
|
-
//#region src/types.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Configuration options for the Windows Event Log sink.
|
|
8
|
-
* @since 1.0.0
|
|
9
|
-
*/
|
|
10
|
-
interface WindowsEventLogSinkOptions {
|
|
11
|
-
/**
|
|
12
|
-
* The name of the event source. This is typically your application name
|
|
13
|
-
* and will appear as the "Source" in Windows Event Viewer.
|
|
14
|
-
*
|
|
15
|
-
* @example "MyApplication"
|
|
16
|
-
*/
|
|
17
|
-
readonly sourceName: string;
|
|
18
|
-
/**
|
|
19
|
-
* The server name to write logs to. Use this for remote logging.
|
|
20
|
-
*
|
|
21
|
-
* @default undefined (local machine)
|
|
22
|
-
*/
|
|
23
|
-
readonly serverName?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Custom mapping of LogTape log levels to Windows Event IDs.
|
|
26
|
-
* Event IDs are numeric identifiers that can be used for filtering
|
|
27
|
-
* and automation in Windows Event Log.
|
|
28
|
-
*
|
|
29
|
-
* @default
|
|
30
|
-
* ```typescript
|
|
31
|
-
* {
|
|
32
|
-
* fatal: 1,
|
|
33
|
-
* error: 2,
|
|
34
|
-
* warning: 3,
|
|
35
|
-
* info: 4,
|
|
36
|
-
* debug: 5,
|
|
37
|
-
* trace: 6
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
readonly eventIdMapping?: Partial<Record<LogLevel, number>>;
|
|
42
|
-
/**
|
|
43
|
-
* The text formatter to use.
|
|
44
|
-
* Defaults to {@link defaultWindowsEventlogFormatter}.
|
|
45
|
-
*/
|
|
46
|
-
formatter?: TextFormatter;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Windows Event Log entry types mapped to LogTape levels.
|
|
50
|
-
* These correspond to the event types visible in Windows Event Viewer.
|
|
51
|
-
* @since 1.0.0
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Platform validation error thrown when trying to use the sink on non-Windows platforms.
|
|
56
|
-
* @since 1.0.0
|
|
57
|
-
*/
|
|
58
|
-
//#endregion
|
|
59
|
-
export { WindowsEventLogSinkOptions };
|
|
60
|
-
//# sourceMappingURL=types.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","names":["LogLevel","TextFormatter","WindowsEventLogSinkOptions","Record","Partial","WindowsPlatformError","Error","WindowsEventLogError"],"sources":["../types.d.ts"],"sourcesContent":["import { LogLevel, TextFormatter } from \"@logtape/logtape\";\n\n//#region src/types.d.ts\n\n/**\n * Configuration options for the Windows Event Log sink.\n * @since 1.0.0\n */\ninterface WindowsEventLogSinkOptions {\n /**\n * The name of the event source. This is typically your application name\n * and will appear as the \"Source\" in Windows Event Viewer.\n *\n * @example \"MyApplication\"\n */\n readonly sourceName: string;\n /**\n * The server name to write logs to. Use this for remote logging.\n *\n * @default undefined (local machine)\n */\n readonly serverName?: string;\n /**\n * Custom mapping of LogTape log levels to Windows Event IDs.\n * Event IDs are numeric identifiers that can be used for filtering\n * and automation in Windows Event Log.\n *\n * @default\n * ```typescript\n * {\n * fatal: 1,\n * error: 2,\n * warning: 3,\n * info: 4,\n * debug: 5,\n * trace: 6\n * }\n * ```\n */\n readonly eventIdMapping?: Partial<Record<LogLevel, number>>;\n /**\n * The text formatter to use.\n * Defaults to {@link defaultWindowsEventlogFormatter}.\n */\n formatter?: TextFormatter;\n}\n/**\n * Windows Event Log entry types mapped to LogTape levels.\n * These correspond to the event types visible in Windows Event Viewer.\n * @since 1.0.0\n */\n\n/**\n * Platform validation error thrown when trying to use the sink on non-Windows platforms.\n * @since 1.0.0\n */\ndeclare class WindowsPlatformError extends Error {\n constructor(platform: string);\n}\n/**\n * Error thrown when Windows Event Log operations fail.\n * @since 1.0.0\n */\ndeclare class WindowsEventLogError extends Error {\n constructor(message: string, cause?: Error);\n}\n//# sourceMappingURL=types.d.ts.map\n//#endregion\nexport { WindowsEventLogError, WindowsEventLogSinkOptions, WindowsPlatformError };\n//# sourceMappingURL=types.d.ts.map"],"mappings":";;;;;;;;;UAQUE,0BAAAA,CAoCID;EAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BALCG,QAAQD,OAAOH;;;;;cAK7BC"}
|