v10.0-69.0

Logging

Logging has been rebuilt from the ground up. There has been modifications to the logging configuration, names, and formats.

To continue using the old logging system see the legacy logging option.

Configuration

The old logging configuration will continue to work. Imagizer will convert your logging configuration automatically.

Old Config Example

{
    "logging": {
        "enable": false,
        "appLogLevel": "info",
        "cloudWatch": {
            "enable": false,
            "key": "",
            "region": "us-east-1",
            "secret": ""
        },
        "dataDog": {
            "enable": false,
            "key": "",
            "namespace": "imagizer",
            "tags": [
            ]
        },
        "syslogFacility": "local7",
        "syslogPort": 514,
        "syslogServer": ""
    }
}

New Config Example

{
    "logging": {
        "enable": false,
        "appLogLevel": "info",
        "cloudWatch": {
            "enable": false,
            "key": "",
            "region": "us-east-1",
            "secret": ""
        },
        "dataDog": {
            "enable": false,
            "key": "",
            "namespace": "imagizer",
            "tags": [
            ]
        },
        "legacy": false,
        "services": [
            "imagizer_access",
            "imagizer_access_err",
            "imagizer_app",
            "imagizer_system"
        ],
        "syslog": {
            "enable": false,
            "facility": "local7",
            "port": 514,
            "protocol": "udp",
            "server": ""
        },
        "trustedProxies": [
        ]
    }
}

legacy

Rather than forcing users to modify their logging strategies, we have added a legacy option. With the legacy property enabled, there will be no changes to the log output.

Services

The new services property contains a list of log services. The default list includes web access, application, and system logs. A full list can be found here.

syslog

The syslogServer, syslogPort, and syslogFacility properties have been moved into a new syslog object. Imagizer will continue to recognize the old properties and remap accordingly. A new syslog protocol property has been added and will allow switching between UDP and TCP.

trustedProxies

A new trustedProxies property has been added. The property will allow for a list of IP addresses or IP ranges of trusted proxies. The access logs will use the X-Forwarded-For header to determine the client IP address only from a trusted proxy.

Example: Behind an AWS load balancer

{
    "trustedProxies": [
      "0.0.0.0/0"
    ]
}

Log Names

We renamed our access logs.

  • nginx_access => imagizer_access
  • nginx_access_err => imagizer_access_err

Log Formats

All logs now use UTC Timestamps.

imagizer_access

We are now using an extended combined log formatopen in new window for the access log. This format is slightly different from our previous nonstandard format.

Nginx Format
$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for" $host $request_time $upstream_http_x_original_filesize $upstream_http_x_original_resolution $upstream_http_x_origin_fetch_time $upstream_http_x_original_response_code
Examples
Old
192.168.0.1 - - [10/Apr/2019:18:17:29 +0000] "GET /image.jpg HTTP/1.1" 45782 200 "-" "Mozilla/5.0 User Agent" - 45782 0.150 3.91.3.127 2019-04-10T18:17:29+00:00 "-" "-" "-" "500x434" "78" "200"
New
192.168.0.1 - - [10/Apr/2019:18:17:29 +0000] "GET /image.jpg HTTP/1.1" 200 45782 "-" "Mozilla/5.0 User Agent" "-" 3.91.3.127 0.001 45782 500x434 316 200

imagizer_app

The timestamp is now RFC3339. All brackets and the fourth column has been removed.

Examples
Old
[Apr 10 18:19:00] [INFO] [/image.jpg] [] imagizer Timer (get_image_info): 7.191
New
2019-04-10T18:09:35.428467+00:00 INFO /image.jpg imagizer Timer (get_image_info): 7.191
Last Updated:
Contributors: Nicholas Pettas