mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-02-01 06:26:38 -06:00
feat: add health checks, OG image generation, and R2 integration
- Implement health check system with caching and singleflight pattern - Add OG image generation via Satori with R2 storage backend - Configure Railway deployment with health check endpoint - Add connection pooling and Unix socket support for Bun SSR - Block external access to internal routes (/internal/*)
This commit is contained in:
+12
-29
@@ -27,46 +27,29 @@ export async function initLogger() {
|
||||
const useJsonLogs =
|
||||
process.env.LOG_JSON === "true" || process.env.LOG_JSON === "1";
|
||||
|
||||
try {
|
||||
if (!useJsonLogs) {
|
||||
await configure({
|
||||
sinks: {
|
||||
console: getConsoleSink(),
|
||||
},
|
||||
filters: {},
|
||||
loggers: [
|
||||
{
|
||||
category: ["logtape", "meta"],
|
||||
lowestLevel: "warning",
|
||||
sinks: ["console"],
|
||||
},
|
||||
{
|
||||
category: [],
|
||||
lowestLevel: "debug",
|
||||
sinks: ["console"],
|
||||
},
|
||||
],
|
||||
});
|
||||
return;
|
||||
}
|
||||
const sinkName = useJsonLogs ? "json" : "console";
|
||||
const sink = useJsonLogs
|
||||
? (record: LogRecord) => {
|
||||
process.stdout.write(railwayFormatter(record));
|
||||
}
|
||||
: getConsoleSink();
|
||||
|
||||
try {
|
||||
await configure({
|
||||
sinks: {
|
||||
json: (record: LogRecord) => {
|
||||
process.stdout.write(railwayFormatter(record));
|
||||
},
|
||||
[sinkName]: sink,
|
||||
},
|
||||
filters: {},
|
||||
loggers: [
|
||||
{
|
||||
category: ["logtape", "meta"],
|
||||
lowestLevel: "warning",
|
||||
sinks: ["json"],
|
||||
sinks: [sinkName],
|
||||
},
|
||||
{
|
||||
category: ["ssr"],
|
||||
lowestLevel: "info",
|
||||
sinks: ["json"],
|
||||
category: [],
|
||||
lowestLevel: "debug",
|
||||
sinks: [sinkName],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user