Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
.minimum_zig_version = "0.17.1",
.dependencies = .{
.zig_common = .{
.url = "git+https://github.com/stackhands/zig-common?ref=v0.11.0#087fec718bc51231055b7d39bcb4b79b6aab07bc",
.hash = "zig_common-0.11.0-kBaPeZhYBQDM1HcfG71qx5QPq24yzH2KIuckzL53zZnV",
.url = "git+https://github.com/stackhands/zig-common?ref=v0.12.0#556a92c8f469449e944175b7dd2993c6037573ed",
.hash = "zig_common-0.12.0-kBaPeZBnBQDdEF6SU_k7R0FFAtuWaDkgydjuzD9sl8_u",
},
},
.paths = .{
Expand Down
1 change: 1 addition & 0 deletions changelog.d/+syslog-own-identity.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Built against `zig-common` 0.12.0: eb-keep-logs names its own identity (`eb-keep-logs`, `ebKeepLogs`) for the events it sends, through `syslog.emitFor`. The events are byte for byte what they were.
7 changes: 5 additions & 2 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const usage_cmd = @import("usage.zig");
const test_bundle = @import("test_bundle.zig");
const lifecycle = @import("lifecycle.zig");
const syslog = common.syslog;
/// The name events are sent under: the program in the syslog header and in
/// journald, and the name in the structured-data identifier.
const syslog_identity: syslog.Identity = .{ .app = "eb-keep-logs", .sd_name = "ebKeepLogs" };
const metrics = @import("metrics.zig");

const Allocator = std.mem.Allocator;
Expand Down Expand Up @@ -679,7 +682,7 @@ fn emitFailedSyslog(
else
(a.print("eb-keep-logs failed: no EasyBuild log kept for {s} ({s})", .{ name, reason }) catch return);

if (!syslog.emit(a, t, 4, msgid, params.items, jfields.items, msg)) {
if (!syslog.emitFor(a, syslog_identity, t, 4, msgid, params.items, jfields.items, msg)) {
warn("cannot emit syslog event", .{});
}
}
Expand Down Expand Up @@ -710,7 +713,7 @@ fn emitRotateSyslog(
.{ .key = "EB_ROTATE_COMPRESSED", .value = comp_s },
.{ .key = "EB_ROTATE_DELETED", .value = del_s },
};
if (!syslog.emit(a, t, 6, "EB_ROTATE_DONE", &params, &jfields, msg)) {
if (!syslog.emitFor(a, syslog_identity, t, 6, "EB_ROTATE_DONE", &params, &jfields, msg)) {
warn("cannot emit syslog event", .{});
}
}
Expand Down
Loading