Skip to content

v10.0-69.0 ​

Logging ​

Logging has been rebuilt from the ground up. The logging configuration, names, and formats have changed.

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 ​

json
{
    "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 ​

json
{
    "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 ​

If you don't want to change your logging setup, enable the legacy property and the log output stays the same.

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 allows switching between UDP and TCP.

trustedProxies ​

The new trustedProxies property accepts a list of IP addresses or IP ranges of trusted proxies. The access logs use the X-Forwarded-For header to determine the client IP address only when the request comes from a trusted proxy.

Example: Behind an AWS load balancer ​

json
{
    "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 format 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 have 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