You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Full-featured slim webserver for microservices with extremely low overhead and r
16
16
## Requirements
17
17
18
18
```bash
19
-
Node.js >= 14.8
19
+
Node.js >= 22
20
20
```
21
21
22
22
## Quick start
@@ -147,6 +147,23 @@ Default `false`
147
147
148
148
Enable request/response logging, format varies from `production` or `development` environments, though to change use e.g. `NODE_ENV=production`
149
149
150
+
#### `logger?` (Object)
151
+
152
+
Configure log outputs for app logs and http request logs.
153
+
154
+
```typescript
155
+
constapp=newBareHttp({
156
+
logging: true,
157
+
logger: {
158
+
app: { file: './logs/app.log' },
159
+
http: { file: './logs/http.log' },
160
+
level: 'debug',
161
+
},
162
+
});
163
+
```
164
+
165
+
`app.file` and `http.file` accept a path string or `{ path, sync }`, and `http.file` is used only when `logging:true`. `console` (default `true`) keeps stdout logging, and `pretty` (default `true` outside production) controls colored console output. `level` sets the base level and can be overridden per target with `app.level` or `http.level`.
0 commit comments