Sonamu๋ LogTape๋ฅผ ์ฌ์ฉํ์ฌ ๊ตฌ์กฐํ๋ ๋ก๊น
์ ์ ๊ณตํฉ๋๋ค. sonamu.config.ts์ logging ์ต์
์ผ๋ก ๋ก๊น
๋์์ ์ค์ ํ ์ ์์ต๋๋ค.
LogTape๋?
LogTape๋ TypeScript๋ฅผ ์ํ ๊ตฌ์กฐํ๋ ๋ก๊น
๋ผ์ด๋ธ๋ฌ๋ฆฌ์
๋๋ค. ๋จ์ํ ๋ฌธ์์ด ๋ก๊ทธ ๋์ , ๊ตฌ์กฐํ๋ ๋ฐ์ดํฐ๋ก ๋ก๊ทธ๋ฅผ ๊ธฐ๋กํฉ๋๋ค.
์ผ๋ฐ ๋ก๊น
vs ๊ตฌ์กฐํ๋ ๋ก๊น
์ผ๋ฐ ๋ก๊น
(๋ฌธ์์ด):
console.log("User login failed: [email protected], reason=invalid_password");
// โ ๋ถ์ํ๋ ค๋ฉด ๋ฌธ์์ด ํ์ฑ ํ์
๊ตฌ์กฐํ๋ ๋ก๊น
(LogTape):
logger.error("User login failed", {
email: "[email protected]",
reason: "invalid_password",
});
// โ ์ด๋ฏธ ๊ตฌ์กฐํ๋ ๋ฐ์ดํฐ, ๋ฐ๋ก ๋ถ์ ๊ฐ๋ฅ
๊ตฌ์กฐํ๋ ๋ก๊น
์ ์ฅ์
- ๊ฒ์/ํํฐ๋ง ์ฉ์ด - ํน์ ์กฐ๊ฑด์ ๋ก๊ทธ๋ง ์ฝ๊ฒ ์ฐพ์ ์ ์์
- ๋ถ์ ๊ฐ๋ฅ - ๋ก๊ทธ ๋ฐ์ดํฐ๋ฅผ ์ง๊ณํ๊ณ ํต๊ณ๋ฅผ ๋ผ ์ ์์
- ํ์
์์ - TypeScript๋ก ๋ก๊ทธ ๋ฐ์ดํฐ ๊ตฌ์กฐ๋ฅผ ๊ฒ์ฆ
- ์ ์ฐํ ์ถ๋ ฅ - ๊ฐ์ ๋ก๊ทธ๋ฅผ ์ฌ๋ฌ ํ์(์ฝ์, ํ์ผ, ์ธ๋ถ ์๋น์ค)์ผ๋ก ์ถ๋ ฅ
ํต์ฌ ๊ฐ๋
1. Sink (์ถ๋ ฅ ๋์)
๋ก๊ทธ๊ฐ ์ต์ข
์ ์ผ๋ก ๊ธฐ๋ก๋๋ ๊ณณ์
๋๋ค.
{
console: getConsoleSink(), // ํฐ๋ฏธ๋ ์ถ๋ ฅ
file: getFileSink("app.log"), // ํ์ผ ์ ์ฅ
sentry: sentrySink, // ์ธ๋ถ ์๋น์ค
}
ํ ๋ก๊ทธ๋ฅผ ์ฌ๋ฌ Sink์ ๋์์ ๊ธฐ๋กํ ์ ์์ต๋๋ค:
- ์ฝ์: ์ค์๊ฐ ๋ชจ๋ํฐ๋ง
- ํ์ผ: ์๊ตฌ ๋ณด๊ด
- Sentry: ์๋ฌ ์๋ฆผ
2. Filter (ํํฐ๋ง ์กฐ๊ฑด)
์ด๋ค ๋ก๊ทธ๋ฅผ ๊ธฐ๋กํ ์ง ๊ฒฐ์ ํฉ๋๋ค.
{
"api-only": (record) => record.url.startsWith("/api"),
"errors": (record) => record.level >= "error",
}
Filter ์์ด๋ ๋ชจ๋ ๋ก๊ทธ๊ฐ ์ถ๋ ฅ๋์ด ์ฑ๋ฅ๊ณผ ๊ฐ๋
์ฑ์ด ์ ํ๋ฉ๋๋ค.
3. Logger (๋ก๊ฑฐ ์ค์ )
์นดํ
๊ณ ๋ฆฌ, Sink, Filter๋ฅผ ์ฐ๊ฒฐํฉ๋๋ค.
{
category: ["fastify"], // ์ด๋ค ์นดํ
๊ณ ๋ฆฌ์ ๋ก๊ทธ์ธ๊ฐ?
sinks: ["console", "file"], // ์ด๋์ ๊ธฐ๋กํ ๊น?
filters: ["api-only"], // ์ด๋ค ์กฐ๊ฑด์ผ๋ก ํํฐ๋งํ ๊น?
lowestLevel: "info", // ์ต์ ์ด๋ค ๋ ๋ฒจ๋ถํฐ?
}
Sink-Filter-Logger์ ๊ด๊ณ
์์:
// 1. Fastify๊ฐ ๋ก๊ทธ ๋ฐ์
logger.info("Request completed", { url: "/api/user" });
// 2. Logger ํ์ธ: category๊ฐ ["fastify"]์ธ๊ฐ? โ
// 3. Filter ํ์ธ: url์ด /api๋ก ์์ํ๋๊ฐ? โ
// 4. Sink ์ถ๋ ฅ: ์ฝ์๊ณผ ํ์ผ์ ๊ธฐ๋ก
๋ก๊ทธ ๋ ๋ฒจ ์ ํ ๊ฐ์ด๋
๋ก๊ทธ ๋ ๋ฒจ์ ๋ก๊ทธ์ ์ค์๋๋ฅผ ๋ํ๋
๋๋ค.
๊ฐ ๋ ๋ฒจ์ ์๋ฏธ์ ์ฌ์ฉ ์๊ธฐ
1. debug
- ์๋ฏธ: ์์ธํ ๋๋ฒ๊น
์ ๋ณด
- ์ฌ์ฉ ์๊ธฐ: ๊ฐ๋ฐ ์ค ๋ฌธ์ ์ถ์
- ์์: ํจ์ ํธ์ถ ์์, ๋ณ์ ๊ฐ
logger.debug("Processing order", { orderId, items });
2. info (๊ธฐ๋ณธ๊ฐ)
- ์๋ฏธ: ์ผ๋ฐ์ ์ธ ์ด์ ์ ๋ณด
- ์ฌ์ฉ ์๊ธฐ: ์ ์ ๋์ ํ์ธ
- ์์: HTTP ์์ฒญ/์๋ต, ์์
์๋ฃ
logger.info("User logged in", { userId });
3. warning
- ์๋ฏธ: ๋ฌธ์ ๊ฐ๋ฅ์ฑ ๊ฒฝ๊ณ
- ์ฌ์ฉ ์๊ธฐ: ์๋ฌ๋ ์๋์ง๋ง ์ฃผ์ ํ์
- ์์: ๋๋ฆฐ ์๋ต, ์ฌ์๋ ๋ฐ์
logger.warn("Slow query detected", { duration: 5000 });
4. error
- ์๋ฏธ: ์ฒ๋ฆฌ ๊ฐ๋ฅํ ์๋ฌ
- ์ฌ์ฉ ์๊ธฐ: ์์ธ ์ฒ๋ฆฌ, ๋ณต๊ตฌ ๊ฐ๋ฅํ ์คํจ
- ์์: ์ ํจ์ฑ ๊ฒ์ฆ ์คํจ, API ํธ์ถ ์คํจ
logger.error("Payment failed", { error: "card_declined" });
5. fatal
- ์๋ฏธ: ์น๋ช
์ ์ค๋ฅ (์๋ฒ ์ค๋จ ์์ค)
- ์ฌ์ฉ ์๊ธฐ: ๋ณต๊ตฌ ๋ถ๊ฐ๋ฅํ ์ฌ๊ฐํ ๋ฌธ์
- ์์: DB ์ฐ๊ฒฐ ์คํจ, ๋ฉ๋ชจ๋ฆฌ ๋ถ์กฑ
logger.fatal("Database connection lost", { error });
ํ๊ฒฝ๋ณ ๋ ๋ฒจ ๊ถ์ฅ์ฌํญ
| ํ๊ฒฝ | ์ต์ ๋ ๋ฒจ | ์ด์ |
|---|
| ๊ฐ๋ฐ | debug | ๋ชจ๋ ์ ๋ณด ํ์ |
| ์คํ
์ด์ง | info | ์ด์ ์ ๋ณด ํ์ธ |
| ํ๋ก๋์
| warning | ์ฑ๋ฅ ๊ณ ๋ ค |
๋ ๋ฒจ ๊ณ์ธต ๊ตฌ์กฐ:
๋ฎ์ ๋ ๋ฒจ์ ์ค์ ํ๋ฉด ๊ทธ๋ณด๋ค ๋์ ๋ชจ๋ ๋ ๋ฒจ์ ๋ก๊ทธ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค. ์: lowestLevel: "warning"์ผ๋ก ์ค์ ํ๋ฉด warning, error, fatal์ด ๋ชจ๋ ์ถ๋ ฅ๋ฉ๋๋ค.
์ ์ด๋ ๊ฒ ์ค๊ณ๋์๋?
1. ๊ธฐ๋ณธ๊ฐ์ด ์์ ํจ
Sonamu์ ๊ธฐ๋ณธ ์ค์ :
{
category: ["fastify"],
sinks: ["fastify-console"],
lowestLevel: "info",
filters: ["fastify-console"], // /api๋ง, healthcheck ์ ์ธ
}
์ด์ :
- โ
/api ๊ฒฝ๋ก๋ง ๋ก๊น
โ ๋ถํ์ํ ์ ์ ํ์ผ ์์ฒญ ์ ์ธ
- โ
info ๋ ๋ฒจ โ ๋๋ฌด ๋ง์ง๋ ์ ์ง๋ ์๊ฒ
- โ
healthcheck ์ ์ธ โ ๋ชจ๋ํฐ๋ง ์์คํ
์ด ์์ฑํ๋ ๋ฐ๋ณต ์์ฒญ ์ ์ธ
2. ํ์ฅ ๊ฐ๋ฅํจ
๊ธฐ๋ณธ ์ค์ ์์ ์ปค์คํ
์ค์ ์ ์ถ๊ฐํ ์ ์์ต๋๋ค:
logging: {
// ๊ธฐ๋ณธ ์ค์ ์ ์งํ๋ฉด์
sinks: {
errorFile: getFileSink("errors.log"), // ์ถ๊ฐ Sink
},
loggers: [
// ์ถ๊ฐ Logger (๊ธฐ๋ณธ Fastify ๋ก๊ฑฐ๋ ์ ์ง๋จ)
{
category: ["app"],
sinks: ["console"],
lowestLevel: "debug",
},
],
}
3. ์ฑ๋ฅ ์ํฅ ์ต์ํ
Filter๋ฅผ ํตํด ๋ถํ์ํ ๋ก๊ทธ๋ฅผ ์กฐ๊ธฐ์ ์ฐจ๋จ:
// โ Filter ์์: ๋ชจ๋ ๋ก๊ทธ ์ฒ๋ฆฌ โ ๋๋ฆผ
logger โ sink (๋ชจ๋ ๋ก๊ทธ ์ถ๋ ฅ)
// โ
Filter ์์: ํ์ํ ๋ก๊ทธ๋ง ์ฒ๋ฆฌ โ ๋น ๋ฆ
logger โ filter (๋ถํ์ํ ๋ก๊ทธ ์ฐจ๋จ) โ sink (ํ์ํ ๋ก๊ทธ๋ง ์ถ๋ ฅ)
๊ธฐ๋ณธ ์ค์
logging ์ต์
์ ์๋ตํ๋ฉด ๊ธฐ๋ณธ ์ค์ ์ด ์๋ ์ ์ฉ๋ฉ๋๋ค.
import { defineConfig } from "sonamu";
export default defineConfig({
// logging ์๋ต ์ ๊ธฐ๋ณธ๊ฐ ์ฌ์ฉ
server: {
// ...
},
});
๊ธฐ๋ณธ ๋์:
- Fastify ์์ฒญ/์๋ต์ ์ฝ์์ ๋ก๊น
/api/* ๊ฒฝ๋ก๋ง ๋ก๊น
(healthcheck ์ ์ธ)
- ์์ ํ์์ผ๋ก ์ถ๋ ฅ (ํ์์คํฌํ, ์นดํ
๊ณ ๋ฆฌ, ๋ ๋ฒจ)
logging ์ต์
type SonamuLoggingOptions<TSinkId extends string, TFilterId extends string> = {
fastifyCategory?: readonly string[];
sinks?: Record<TSinkId, Sink>;
filters?: Record<TFilterId, FilterLike>;
loggers?: LoggerConfig<TSinkId, TFilterId>[];
};
๋ก๊น
๋นํ์ฑํ
export default defineConfig({
logging: false, // ๋ชจ๋ ๋ก๊น
๋นํ์ฑํ
server: {
// ...
},
});
fastifyCategory
Fastify HTTP ๋ก๊น
์ ์ฌ์ฉํ ์นดํ
๊ณ ๋ฆฌ๋ฅผ ์ง์ ํฉ๋๋ค.
ํ์
: readonly string[]
๊ธฐ๋ณธ๊ฐ: ["fastify"]
export default defineConfig({
logging: {
fastifyCategory: ["myapp", "http"], // ์ปค์คํ
์นดํ
๊ณ ๋ฆฌ
},
server: {
// ...
},
});
์นดํ
๊ณ ๋ฆฌ ํ์: ["a", "b", "c"] ๋ฐฐ์ด๋ก ๊ณ์ธต ๊ตฌ์กฐ ํํ
๋ก๊ทธ ์ถ๋ ฅ ์์:
[2025-01-09 12:34:56] [myapp.http] INFO: [GET:200] /api/user/list - Request completed
๋ก๊ทธ๋ฅผ ์ถ๋ ฅํ ๋์(sink)์ ์ถ๊ฐํฉ๋๋ค.
ํ์
: Record<string, Sink>
import { defineConfig } from "sonamu";
import { getConsoleSink, getFileSink } from "@logtape/logtape";
export default defineConfig({
logging: {
sinks: {
console: getConsoleSink(),
file: getFileSink("logs/app.log"),
},
},
server: {
// ...
},
});
"fastify-console" ์ด๋ฆ์ Sonamu๊ฐ ์๋์ผ๋ก ์์ฑํ๋ ๊ธฐ๋ณธ sink์
๋๋ค. ์ด ์ด๋ฆ์ผ๋ก ์ถ๊ฐํ๋ฉด ๊ธฐ๋ณธ sink๋ฅผ ๋ฎ์ด์๋๋ค.
filters
๋ก๊ทธ๋ฅผ ์ ํ์ ์ผ๋ก ํํฐ๋งํ๋ ์กฐ๊ฑด์ ์ถ๊ฐํฉ๋๋ค.
ํ์
: Record<string, FilterLike>
import { defineConfig } from "sonamu";
import type { LogRecord } from "@logtape/logtape";
export default defineConfig({
logging: {
filters: {
"errors-only": (record: LogRecord) => record.level >= "error",
},
},
server: {
// ...
},
});
"fastify-console" ์ด๋ฆ์ Sonamu๊ฐ ์๋์ผ๋ก ์์ฑํ๋ ๊ธฐ๋ณธ filter์
๋๋ค. ์ด ์ด๋ฆ์ผ๋ก ์ถ๊ฐํ๋ฉด ๊ธฐ๋ณธ filter๋ฅผ ๋ฎ์ด์๋๋ค.
loggers
์นดํ
๊ณ ๋ฆฌ๋ณ๋ก ์ด๋ค sink์ filter๋ฅผ ์ฌ์ฉํ ์ง ์ค์ ํฉ๋๋ค.
ํ์
: LoggerConfig[]
import { defineConfig } from "sonamu";
import { getConsoleSink } from "@logtape/logtape";
export default defineConfig({
logging: {
sinks: {
console: getConsoleSink(),
},
loggers: [
{
category: ["fastify"],
sinks: ["console"],
lowestLevel: "info",
},
],
},
server: {
// ...
},
});
fastifyCategory์ ์ค์ ๋ ์นดํ
๊ณ ๋ฆฌ์ logger ์ค์ ์ด ์์ผ๋ฉด, Sonamu๋ ๊ธฐ๋ณธ logger๋ฅผ ์ถ๊ฐํ์ง ์์ต๋๋ค.
๊ธฐ๋ณธ ์์
์ต์ ์ค์ (๊ธฐ๋ณธ๊ฐ ์ฌ์ฉ)
import { defineConfig } from "sonamu";
export default defineConfig({
server: {
listen: { port: 1028 },
},
});
๋ก๊น
๋นํ์ฑํ
import { defineConfig } from "sonamu";
export default defineConfig({
logging: false,
server: {
listen: { port: 1028 },
},
});
์ปค์คํ
์นดํ
๊ณ ๋ฆฌ
import { defineConfig } from "sonamu";
export default defineConfig({
logging: {
fastifyCategory: ["app", "server", "http"],
},
server: {
listen: { port: 1028 },
},
});
๊ธฐ๋ณธ ๋์ ์์ธ
Sonamu๋ ๋ค์๊ณผ ๊ฐ์ด ์๋์ผ๋ก ๋ก๊น
์ ์ค์ ํฉ๋๋ค:
1. Fastify Sink ์๋ ์์ฑ
// ์๋ ์์ฑ๋๋ "fastify-console" sink
{
type: "console",
formatter: prettyFormatter({
timestamp: "time",
categoryWidth: 20,
categoryTruncate: "middle",
}),
}
ํน์ง:
- HTTP ๋ฉ์๋์ ์๋ต ์ฝ๋ ํ์:
[GET:200]
- ์์ฒญ URL ํ์:
/api/user/list
- ์์์ผ๋ก ๋ ๋ฒจ ๊ตฌ๋ถ
2. Fastify Filter ์๋ ์์ฑ
// ์๋ ์์ฑ๋๋ "fastify-console" filter
(record) => {
// /api๋ก ์์ํ๋ ๊ฒฝ๋ก๋ง, healthcheck ์ ์ธ
return request.url.startsWith("/api") &&
request.url !== "/api/healthcheck";
}
3. Logger ์๋ ์์ฑ
// ์๋ ์์ฑ๋๋ logger
{
category: ["fastify"], // ๋๋ ์ฌ์ฉ์ ์ง์ fastifyCategory
sinks: ["fastify-console"],
lowestLevel: "info",
filters: ["fastify-console"],
}
// ์๋ ์ถ๊ฐ๋๋ logger
{
category: ["logtape", "meta"],
lowestLevel: "fatal", // LogTape ๋ด๋ถ ๋ก๊ทธ ์จ๊น
}
๋ก๊ทธ ๋ ๋ฒจ
LogTape์ ๋ก๊ทธ ๋ ๋ฒจ (๋ฎ์ ์์):
- debug - ์์ธํ ๋๋ฒ๊น
์ ๋ณด
- info - ์ผ๋ฐ ์ ๋ณด (๊ธฐ๋ณธ๊ฐ)
- warning - ๊ฒฝ๊ณ
- error - ์๋ฌ
- fatal - ์น๋ช
์ ์ค๋ฅ
์ค์ ์์
๊ฐ๋ฐ
์คํ
์ด์ง
ํ๋ก๋์
import { defineConfig } from "sonamu";
export default defineConfig({
logging: {
fastifyCategory: ["fastify"],
loggers: [
{
category: ["fastify"],
sinks: ["fastify-console"],
lowestLevel: "debug", // ๋ชจ๋ ๋ก๊ทธ ํ์ธ
filters: ["fastify-console"],
},
],
},
server: {
listen: { port: 1028 },
},
});
ํน์ง:
debug ๋ ๋ฒจ๋ก ๋ชจ๋ ์์ธ ์ ๋ณด ํ์ธ
- ์ฝ์ ์ถ๋ ฅ์ผ๋ก ์ค์๊ฐ ํ์ธ
- ๋น ๋ฅธ ํผ๋๋ฐฑ ๋ฃจํ
import { defineConfig } from "sonamu";
import { getConsoleSink, getFileSink } from "@logtape/logtape";
export default defineConfig({
logging: {
sinks: {
console: getConsoleSink(),
file: getFileSink("logs/app.log"),
},
loggers: [
{
category: ["fastify"],
sinks: ["console", "file"],
lowestLevel: "info", // ์ด์ ์ ๋ณด
},
],
},
server: {
listen: { port: 1028 },
},
});
ํน์ง:
info ๋ ๋ฒจ๋ก ์ด์ ์ ๋ณด ์์ง
- ์ฝ์ + ํ์ผ๋ก ์ด์ค ๊ธฐ๋ก
- ํ๋ก๋์
ํ๊ฒฝ ํ
์คํธ
import { defineConfig } from "sonamu";
import { getConsoleSink, getFileSink } from "@logtape/logtape";
export default defineConfig({
logging: {
sinks: {
console: getConsoleSink(),
errorLog: getFileSink("logs/errors.log"),
},
filters: {
"errors": (record) => record.level >= "error",
},
loggers: [
// ์ฝ์: warning ์ด์๋ง
{
category: ["fastify"],
sinks: ["console"],
lowestLevel: "warning",
},
// ํ์ผ: ์๋ฌ๋ง
{
category: ["fastify"],
sinks: ["errorLog"],
filters: ["errors"],
lowestLevel: "error",
},
],
},
server: {
listen: { port: 1028 },
},
});
ํน์ง:
warning ๋ ๋ฒจ๋ก ๋ฌธ์ ๋ง ํ์ธ
- ์๋ฌ๋ ๋ณ๋ ํ์ผ ์ ์ฅ
- ์ฑ๋ฅ ์ํฅ ์ต์ํ
ํ์ผ ๋ก๊น
์ถ๊ฐ
import { defineConfig } from "sonamu";
import { getConsoleSink, getFileSink } from "@logtape/logtape";
export default defineConfig({
logging: {
sinks: {
console: getConsoleSink(),
file: getFileSink("logs/app.log"),
errorFile: getFileSink("logs/errors.log"),
},
filters: {
"errors-only": (record) => record.level >= "error",
},
loggers: [
// ์ฝ์: ๋ชจ๋ ๋ก๊ทธ
{
category: ["fastify"],
sinks: ["console"],
lowestLevel: "info",
},
// ํ์ผ: ๋ชจ๋ ๋ก๊ทธ
{
category: ["fastify"],
sinks: ["file"],
lowestLevel: "info",
},
// ์๋ฌ ํ์ผ: ์๋ฌ๋ง
{
category: ["fastify"],
sinks: ["errorFile"],
filters: ["errors-only"],
lowestLevel: "error",
},
],
},
server: {
listen: { port: 1028 },
},
});
ํ๋ก๋์
์ค์
import { defineConfig } from "sonamu";
import { getConsoleSink, getFileSink } from "@logtape/logtape";
export default defineConfig({
logging: {
sinks: {
console: getConsoleSink(),
errorLog: getFileSink("logs/errors.log"),
},
filters: {
"errors": (record) => record.level >= "error",
},
loggers: [
// ์ฝ์: warning ์ด์๋ง
{
category: ["fastify"],
sinks: ["console"],
lowestLevel: "warning",
},
// ํ์ผ: ์๋ฌ๋ง
{
category: ["fastify"],
sinks: ["errorLog"],
filters: ["errors"],
lowestLevel: "error",
},
],
},
server: {
listen: { port: 1028 },
},
});
Fastify ๋ก๊น
์๋ ํตํฉ
Sonamu๋ @logtape/fastify ํจํค์ง๋ก Fastify ๋ก๊น
์ ์๋ ํตํฉํฉ๋๋ค.
// Sonamu ๋ด๋ถ์์ ์๋์ผ๋ก ์ํ
import { getLogTapeFastifyLogger } from "@logtape/fastify";
const server = fastify({
logger: getLogTapeFastifyLogger({
category: config.logging?.fastifyCategory ?? ["fastify"],
}),
});
์๋์ผ๋ก ๋ก๊น
๋๋ ์ ๋ณด:
- HTTP ์์ฒญ (method, URL)
- ์๋ต ์ฝ๋
- ์๋ต ์๊ฐ
- ์๋ฌ ์คํํธ๋ ์ด์ค
์ฃผ์์ฌํญ
1. ๊ธฐ๋ณธ sink/filter ๋ฎ์ด์ฐ๊ธฐ
// โ ๋์ ์: ๊ธฐ๋ณธ ์ค์ ์์ค
logging: {
sinks: {
"fastify-console": getConsoleSink(), // ๊ธฐ๋ณธ formatter ์์ค
},
}
// โ
์ข์ ์: ๋ค๋ฅธ ์ด๋ฆ ์ฌ์ฉ
logging: {
sinks: {
"my-console": getConsoleSink(),
},
}
2. ๋ก๊น
๋นํ์ฑํ ์ logger ์ต์
// โ ๋์ ์: ์ถฉ๋
logging: false,
server: {
fastify: {
logger: true, // logging: false์ ์ถฉ๋
},
}
// โ
์ข์ ์: ์ผ๊ด์ฑ ์ ์ง
logging: false,
server: {
fastify: {
// logger ์ค์ ์ ํจ (๊ธฐ๋ณธ๊ฐ ์ฌ์ฉ)
},
}
3. ์นดํ
๊ณ ๋ฆฌ ์ผ๊ด์ฑ
// โ
์ข์ ์: ์ผ๊ด๋ ์นดํ
๊ณ ๋ฆฌ
fastifyCategory: ["app", "http"]
// โ ๋์ ์: ์๋ฏธ ์๋ ์นดํ
๊ณ ๋ฆฌ
fastifyCategory: ["a", "b", "c"]
๋ค์ ๋จ๊ณ