Add comprehensive logging with tracing, file rotation, and systemd integration

- Add tracing-appender and tracing-journald for production logging
- Add LoggingConfig with trace_sample_rate, json_output, journald options
- Expand init_logging() with file rotation, journald, and stderr layers
- Add sanitize_path() helper for PII protection in logs
- Instrument FUSE operations with #[instrument] and trace decision points
- Instrument gRPC handlers (10 methods) with span correlation
- Add spawn instrumentation for health monitor, indexer, watcher tasks
- Add broadcast lag handling (RecvError::Lagged) in event subscribers
- Fix webhook.rs expect() calls with proper error handling
- Add logging to patterns.rs, collections.rs, artwork.rs database ops
- Add Drop impl logging for PluginManager and WatchHandle
- Update systemd service with rate limiting and journal output
- Add logrotate config and example config.toml with logging section
This commit is contained in:
Alexander
2026-05-13 11:21:51 +02:00
parent bc9fa36646
commit 5ac33987c0
32 changed files with 1646 additions and 177 deletions
+81 -14
View File
@@ -1764,7 +1764,7 @@ dependencies = [
"serde",
"sled",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"tokio",
"tracing",
]
@@ -1784,7 +1784,7 @@ dependencies = [
"serde",
"sled",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"tokio",
"tracing",
"xxhash-rust",
@@ -1805,6 +1805,8 @@ dependencies = [
"musicfs-origins",
"tokio",
"tracing",
"tracing-appender",
"tracing-journald",
"tracing-subscriber",
]
@@ -1816,9 +1818,10 @@ dependencies = [
"serde",
"serde_json",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"tokio",
"toml",
"tracing",
"xxhash-rust",
]
@@ -1854,6 +1857,7 @@ dependencies = [
"serde_json",
"sha2",
"tempfile",
"thiserror 1.0.69",
"tokio",
"tokio-stream",
"tonic",
@@ -1868,7 +1872,7 @@ dependencies = [
"image",
"musicfs-core",
"symphonia",
"thiserror",
"thiserror 1.0.69",
"tracing",
]
@@ -1881,7 +1885,7 @@ dependencies = [
"libc",
"musicfs-core",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"tokio",
"tracing",
]
@@ -1897,7 +1901,7 @@ dependencies = [
"serde",
"serde_json",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"tokio",
"tracing",
"wasmtime",
@@ -1915,7 +1919,7 @@ dependencies = [
"serde_json",
"tantivy",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"tokio",
"tracing",
]
@@ -1932,7 +1936,7 @@ dependencies = [
"rmp-serde",
"serde",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"tokio",
"tracing",
"xxhash-rust",
@@ -2460,7 +2464,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
dependencies = [
"getrandom 0.2.17",
"libredox",
"thiserror",
"thiserror 1.0.69",
]
[[package]]
@@ -2893,6 +2897,12 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "symlink"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a"
[[package]]
name = "symphonia"
version = "0.5.5"
@@ -3126,7 +3136,7 @@ dependencies = [
"tantivy-stacker",
"tantivy-tokenizer-api",
"tempfile",
"thiserror",
"thiserror 1.0.69",
"time",
"uuid",
"winapi",
@@ -3247,7 +3257,16 @@ version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [
"thiserror-impl",
"thiserror-impl 1.0.69",
]
[[package]]
name = "thiserror"
version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
dependencies = [
"thiserror-impl 2.0.18",
]
[[package]]
@@ -3261,6 +3280,17 @@ dependencies = [
"syn",
]
[[package]]
name = "thiserror-impl"
version = "2.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "thread_local"
version = "1.1.9"
@@ -3507,6 +3537,19 @@ dependencies = [
"tracing-core",
]
[[package]]
name = "tracing-appender"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "050686193eb999b4bb3bc2acfa891a13da00f79734704c4b8b4ef1a10b368a3c"
dependencies = [
"crossbeam-channel",
"symlink",
"thiserror 2.0.18",
"time",
"tracing-subscriber",
]
[[package]]
name = "tracing-attributes"
version = "0.1.31"
@@ -3528,6 +3571,17 @@ dependencies = [
"valuable",
]
[[package]]
name = "tracing-journald"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d3a81ed245bfb62592b1e2bc153e77656d94ee6a0497683a65a12ccaf2438d0"
dependencies = [
"libc",
"tracing-core",
"tracing-subscriber",
]
[[package]]
name = "tracing-log"
version = "0.2.0"
@@ -3539,6 +3593,16 @@ dependencies = [
"tracing-core",
]
[[package]]
name = "tracing-serde"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1"
dependencies = [
"serde",
"tracing-core",
]
[[package]]
name = "tracing-subscriber"
version = "0.3.23"
@@ -3549,12 +3613,15 @@ dependencies = [
"nu-ansi-term",
"once_cell",
"regex-automata",
"serde",
"serde_json",
"sharded-slab",
"smallvec",
"thread_local",
"tracing",
"tracing-core",
"tracing-log",
"tracing-serde",
]
[[package]]
@@ -3944,7 +4011,7 @@ dependencies = [
"log",
"object 0.32.2",
"target-lexicon",
"thiserror",
"thiserror 1.0.69",
"wasmparser 0.201.0",
"wasmtime-cranelift-shared",
"wasmtime-environ",
@@ -3985,7 +4052,7 @@ dependencies = [
"serde",
"serde_derive",
"target-lexicon",
"thiserror",
"thiserror 1.0.69",
"wasm-encoder 0.201.0",
"wasmparser 0.201.0",
"wasmprinter",
@@ -4076,7 +4143,7 @@ dependencies = [
"cranelift-entity",
"serde",
"serde_derive",
"thiserror",
"thiserror 1.0.69",
"wasmparser 0.201.0",
]