feat: make Fedify log level configurable via logLevel option
Default changed from "info" to "warning" so production logs are quiet. Set logLevel to "info" or "debug" in config to troubleshoot federation.
This commit is contained in:
@@ -262,6 +262,7 @@ On restart, `refollow:pending` entries are reset to `import` to prevent stale cl
|
||||
redisUrl: "", // Redis for delivery queue (empty = in-process)
|
||||
parallelWorkers: 5, // Parallel delivery workers (with Redis)
|
||||
actorType: "Person", // Person | Service | Organization | Group
|
||||
logLevel: "warning", // Fedify log level: debug | info | warning | error | fatal
|
||||
timelineRetention: 1000, // Max timeline items (0 = unlimited)
|
||||
}
|
||||
```
|
||||
|
||||
@@ -93,6 +93,7 @@ export default {
|
||||
| `redisUrl` | string | `""` | Redis connection URL for delivery queue |
|
||||
| `parallelWorkers` | number | `5` | Number of parallel delivery workers (requires Redis) |
|
||||
| `actorType` | string | `"Person"` | Actor type: `Person`, `Service`, `Organization`, or `Group` |
|
||||
| `logLevel` | string | `"warning"` | Fedify log level: `"debug"`, `"info"`, `"warning"`, `"error"`, `"fatal"` |
|
||||
| `timelineRetention` | number | `1000` | Maximum timeline items to keep (0 = unlimited) |
|
||||
|
||||
### Redis (Recommended for Production)
|
||||
|
||||
@@ -82,6 +82,7 @@ const defaults = {
|
||||
redisUrl: "",
|
||||
parallelWorkers: 5,
|
||||
actorType: "Person",
|
||||
logLevel: "warning",
|
||||
timelineRetention: 1000,
|
||||
notificationRetentionDays: 30,
|
||||
};
|
||||
@@ -891,6 +892,7 @@ export default class ActivityPubEndpoint {
|
||||
publicationUrl: this._publicationUrl,
|
||||
parallelWorkers: this.options.parallelWorkers,
|
||||
actorType: this.options.actorType,
|
||||
logLevel: this.options.logLevel,
|
||||
});
|
||||
|
||||
this._federation = federation;
|
||||
|
||||
@@ -60,6 +60,7 @@ export function setupFederation(options) {
|
||||
publicationUrl = "",
|
||||
parallelWorkers = 5,
|
||||
actorType = "Person",
|
||||
logLevel = "warning",
|
||||
} = options;
|
||||
|
||||
// Map config string to Fedify actor class
|
||||
@@ -67,6 +68,9 @@ export function setupFederation(options) {
|
||||
const ActorClass = actorTypeMap[actorType] || Person;
|
||||
|
||||
// Configure LogTape for Fedify delivery logging (once per process)
|
||||
// Valid levels: "debug" | "info" | "warning" | "error" | "fatal"
|
||||
const validLevels = ["debug", "info", "warning", "error", "fatal"];
|
||||
const resolvedLevel = validLevels.includes(logLevel) ? logLevel : "warning";
|
||||
if (!_logtapeConfigured) {
|
||||
_logtapeConfigured = true;
|
||||
configure({
|
||||
@@ -79,7 +83,7 @@ export function setupFederation(options) {
|
||||
// All Fedify logs — federation, vocab, delivery, HTTP signatures
|
||||
category: ["fedify"],
|
||||
sinks: ["console"],
|
||||
lowestLevel: "info",
|
||||
lowestLevel: resolvedLevel,
|
||||
},
|
||||
],
|
||||
}).catch((error) => {
|
||||
|
||||
Reference in New Issue
Block a user