Skip to main content

Version 5.3 release notes

· 2 min read
Loïc Poullain
Creator of FoalTS. Software engineer.

Banner

Version 5.3 of Foal is out!

New dev-verbose logging format

Foal's logger already offered three output formats: raw (default), dev and json. Version 5.3 introduces a fourth one: dev-verbose.

Until now, you had to choose between:

  • the dev format, which is colorful and concise but only displays the error parameter, and
  • the raw format, which logs every parameter (request ID, user ID, etc.) but without colors and with a more verbose layout.

The new dev-verbose format gives you the best of both worlds. It keeps the colors and the concise messages of the dev format (small timestamp, colored levels, prettified HTTP and Socket.io logs) while also displaying all the parameters passed to the logger, like the raw format does.

This is especially useful in a development environment when you need to inspect the full log context without losing the readability of the dev format.

How to use it

Set the format in your configuration:

config/development.json

{
"settings": {
"logger": {
"format": "dev-verbose"
}
}
}

For HTTP and Socket.io logs, the parameters that are already displayed in the message line (such as method, url, statusCode, responseTime, eventName or status) are not repeated in the context block, so you get the extra context without any duplication.

New HttpResponseUnprocessableContent (HTTP 422)

Version 5.3 also adds a new HttpResponseUnprocessableContent class (with its isHttpResponseUnprocessableContent type guard) to return an HTTP 422 Unprocessable Content response.

Thanks to James Kingsthwaite for contributing this feature!

New forcePathStyle option for AWS S3 storage

The @foal/aws-s3 package now supports a new settings.disk.s3.forcePathStyle configuration option. When set to true, the S3 client uses path-style requests (https://s3.region.amazonaws.com/bucket/key) instead of the default virtual-hosted-style requests (https://bucket.s3.region.amazonaws.com/key).

This is particularly useful when targeting S3-compatible services (such as MinIO or LocalStack) that require path-style addressing.

config/default.json

{
"settings": {
"disk": {
"s3": {
"forcePathStyle": true
}
}
}
}

Thanks to sfozz for contributing this feature!