diff --git a/CHANGELOG.md b/CHANGELOG.md index f57c28bc..9ffe6949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master +- New default log format; +- `structured` and `json` log formats. Can be set with `IMGPROXY_LOG_FORMAT`; +- Better watermarking: image transparency doesn't affect watermarks, faster watermark scaling. + ## v2.4.1 - More verbose URL parsing errors; diff --git a/docs/configuration.md b/docs/configuration.md index 3c45a3eb..3cc53d0e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -192,15 +192,22 @@ imgproxy can report occurred errors to Bugsnag, Honeybadger and Sentry: * `IMGPROXY_SENTRY_ENVIRONMENT`: Sentry environment to report to. Default: `production`. * `IMGPROXY_SENTRY_RELEASE`: Sentry release to report to. Default: `imgproxy/{imgproxy version}`. -### Syslog +### Log + +* `IMGPROXY_LOG_FORMAT`: the log format. The following formats are supported: + * `pretty`: _(default)_ colored human-readable format; + * `structured`: machine-readable format; + * `json`: JSON format; imgproxy can send logs to syslog, but this feature is disabled by default. To enable it, set `IMGPROXY_SYSLOG_ENABLE` to `true`: * `IMGPROXY_SYSLOG_ENABLE`: when `true`, enables sending logs to syslog; -* `IMGPROXY_SYSLOG_LEVEL`: maximum log level to send to syslog. Known levels are: `crit`, `error`, `warning` and `notice`. Default: `notice`; +* `IMGPROXY_SYSLOG_LEVEL`: maximum log level to send to syslog. Known levels are: `crit`, `error`, `warning` and `info`. Default: `info`; * `IMGPROXY_SYSLOG_NETWORK`: network that will be used to connect to syslog. When blank, the local syslog server will be used. Known networks are `tcp`, `tcp4`, `tcp6`, `udp`, `udp4`, `udp6`, `ip`, `ip4`, `ip6`, `unix`, `unixgram` and `unixpacket`. Default: blank; * `IMGPROXY_SYSLOG_ADDRESS`: address of the syslog service. Not used if `IMGPROXY_SYSLOG_NETWORK` is blank. Default: blank; -* `IMGPROXY_SYSLOG_TAG`: specific syslogtag. Default: `imgproxy`; +* `IMGPROXY_SYSLOG_TAG`: specific syslog tag. Default: `imgproxy`; + +**Note:** imgproxy always uses structured log format for syslog. ### Memory usage tweaks diff --git a/docs/generating_the_url_advanced.md b/docs/generating_the_url_advanced.md index b30ce8c1..8779ad53 100644 --- a/docs/generating_the_url_advanced.md +++ b/docs/generating_the_url_advanced.md @@ -218,7 +218,7 @@ wm:%opacity:%position:%x_offset:%y_offset:%scale Puts watermark on the processed image. -* `opacity` - watermark opacity modifier. Final opacity is calculated like `base_opacity * opacity`. It's highly recommended to set this argument as `1` and adjust opacity with `IMGPROXY_WATERMARK_OPACITY` since this would optimize performance and memory usage. +* `opacity` - watermark opacity modifier. Final opacity is calculated like `base_opacity * opacity`. * `position` - (optional) specifies the position of the watermark. Available values: * `ce`: (default) center; * `no`: north (top edge); diff --git a/docs/watermark.md b/docs/watermark.md index 657aceea..7e7288f1 100644 --- a/docs/watermark.md +++ b/docs/watermark.md @@ -6,12 +6,14 @@ imgproxy supports watermarking processed images with another image. There are three ways to specify a watermark image using environment variables: -* `IMGPROXY_WATERMARK_DATA` - Base64-encoded image data. You can easily calculate it with `base64 tmp/watermark.png | tr -d '\n'`. +* `IMGPROXY_WATERMARK_DATA` - Base64-encoded image data. You can easily calculate it with `base64 tmp/watermark.webp | tr -d '\n'`. * `IMGPROXY_WATERMARK_PATH` - path to the locally stored image. * `IMGPROXY_WATERMARK_URL` - watermark image URL. You can also specify the base opacity of watermark with `IMGPROXY_WATERMARK_OPACITY`. +**Note:** If you're going to use `scale` argument of `watermark`, it's highly recommended to use SVG, WebP or JPEG watermarks since these formats support scale-on-load. + ## Watermarking an image Watermarks are only available with [advanced URL format](generating_the_url_advanced.md). Use `watermark` processing option to put the watermark on the processed image: @@ -23,7 +25,7 @@ wm:%opacity:%position:%x_offset:%y_offset:%scale Where arguments are: -* `opacity` - watermark opacity modifier. Final opacity is calculated like `base_opacity * opacity`. It's highly recommended to set this argument as `1` and adjust opacity with `IMGPROXY_WATERMARK_OPACITY` since this would optimize performance and memory usage. +* `opacity` - watermark opacity modifier. Final opacity is calculated like `base_opacity * opacity`. * `position` - (optional) specifies the position of the watermark. Available values: * `ce`: (default) center; * `no`: north (top edge);