Skip to content

Commit 083de34

Browse files
committed
Add logging section to the README
1 parent db21ad8 commit 083de34

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/fastboot-app-server/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ let server = new FastBootAppServer({
4242
host: '0.0.0.0', // Optional - Sets the host the server listens on.
4343
port: 4000, // Optional - Sets the port the server listens on (defaults to the PORT env var or 3000).
4444
buildSandboxGlobals(defaultGlobals) { // Optional - Make values available to the Ember app running in the FastBoot server, e.g. "MY_GLOBAL" will be available as "GLOBAL_VALUE"
45+
log: true, // Optional - Specifies whether the server should use its default request logging. Useful for turning off default logging when providing custom logging middlewares
4546
return Object.assign({}, defaultGlobals, { GLOBAL_VALUE: MY_GLOBAL });
4647
},
4748
chunkedResponse: true // Optional - Opt-in to chunked transfer encoding, transferring the head, body and potential shoeboxes in separate chunks. Chunked transfer encoding should have a positive effect in particular when the app transfers a lot of data in the shoebox.
@@ -134,6 +135,26 @@ const server = FastBootAppServer({
134135
})
135136
```
136137

138+
## Logging
139+
140+
We provide simple log output by default, but if you want more logging control, you can disable the
141+
simple logger using the `log: false` option, and provide a custom middleware that suits your logging needs:
142+
143+
```js
144+
let server = new FastBootAppServer({
145+
log: false,
146+
beforeMiddleware: function(app) {
147+
let logger = function(req, res, next) {
148+
console.log('Hello from custom request logger');
149+
150+
next();
151+
};
152+
153+
app.use(logger);
154+
},
155+
});
156+
```
157+
137158
## Downloaders
138159

139160
You can point the app server at a static path that you manage, but that

0 commit comments

Comments
 (0)