file-logger

    Attributes

    This is an example of how to enable the plugin for a specific route.

    Test Plugin

    You can then find the file.log file in the corresponding directory.

    NameTypeRequirementDefaultValidDescription
    log_formatobjectoptional{“host”: “$host”, “@timestamp”: “$time_iso8601”, “client_ip”: “$remote_addr”}Log format declared as key value pair in JSON format. Only string is supported in the value part. If the value starts with , it means to get or Nginx variable.

    Disable Plugin

    Remove the corresponding json configuration in the plugin configuration to disable the file-logger. APISIX plugins are hot-reloaded, therefore no need to restart APISIX.