##-------------------------------------------------------------------- ## Log ##-------------------------------------------------------------------- ## Where to emit the logs. ## Enable the console (standard output) logs. ## ## Value: off | file | console | both ## - off: disable logs entirely ## - file: write logs only to file ## - console: write logs only to standard I/O ## - both: write logs both to file and standard I/O log.to = file ## The log severity level. ## ## Value: debug | info | notice | warning | error | critical | alert | emergency ## ## Note: Only the messages with severity level higher than or equal to ## this level will be logged. ## ## Default: warning log.level = warning ## The dir for log files. ## ## Value: Folder log.dir = {{ platform_log_dir }} ## The log filename for logs of level specified in "log.level". ## ## If `log.rotation` is enabled, this is the base name of the ## files. Each file in a rotated log is named .N, where N is an integer. ## ## Value: String ## Default: emqx.log log.file = emqx.log ## Limits the total number of characters printed for each log event. ## ## Value: Integer ## Default: No Limit #log.chars_limit = 8192 ## Enables the log rotation. ## With this enabled, new log files will be created when the current ## log file is full, max to `log.rotation.size` files will be created. ## ## Value: on | off ## Default: on log.rotation = on ## Maximum size of each log file. ## ## Value: Number ## Default: 10M ## Supported Unit: KB | MB | GB log.rotation.size = 10MB ## Maximum rotation count of log files. ## ## Value: Number ## Default: 5 log.rotation.count = 5 ## To create additional log files for specific log levels. ## ## Value: File Name ## Format: log.$level.file = $filename, ## where "$level" can be one of: debug, info, notice, warning, ## error, critical, alert, emergency ## Note: Log files for a specific log level will only contain all the logs ## that higher than or equal to that level ## #log.info.file = info.log #log.error.file = error.log ## The max allowed queue length before switching to sync mode. ## ## Log overload protection parameter. If the message queue grows ## larger than this value the handler switches from anync to sync mode. ## ## Default: 100 ## #log.sync_mode_qlen = 100 ## The max allowed queue length before switching to drop mode. ## ## Log overload protection parameter. When the message queue grows ## larger than this threshold, the handler switches to a mode in which ## it drops all new events that senders want to log. ## ## Default: 3000 ## #log.drop_mode_qlen = 3000 ## The max allowed queue length before switching to flush mode. ## ## Log overload protection parameter. If the length of the message queue ## grows larger than this threshold, a flush (delete) operation takes place. ## To flush events, the handler discards the messages in the message queue ## by receiving them in a loop without logging. ## ## Default: 8000 ## #log.flush_qlen = 8000 ## Kill the log handler when it gets overloaded. ## ## Log overload protection parameter. It is possible that a handler, ## even if it can successfully manage peaks of high load without crashing, ## can build up a large message queue, or use a large amount of memory. ## We could kill the log handler in these cases and restart it after a ## few seconds. ## ## Default: on ## #log.overload_kill = on ## The max allowed queue length before killing the log hanlder. ## ## Log overload protection parameter. This is the maximum allowed queue ## length. If the message queue grows larger than this, the handler ## process is terminated. ## ## Default: 20000 ## #log.overload_kill_qlen = 20000 ## The max allowed memory size before killing the log hanlder. ## ## Log overload protection parameter. This is the maximum memory size ## that the handler process is allowed to use. If the handler grows ## larger than this, the process is terminated. ## ## Default: 30MB ## #log.overload_kill_mem_size = 30MB ## Restart the log hanlder after some seconds. ## ## Log overload protection parameter. If the handler is terminated, ## it restarts automatically after a delay specified in seconds. ## The value "infinity" prevents restarts. ## ## Default: 5s ## #log.overload_kill_restart_after = 5s ## Max burst count and time window for burst control. ## ## Log overload protection parameter. Large bursts of log events - many ## events received by the handler under a short period of time - can ## potentially cause problems. By specifying the maximum number of events ## to be handled within a certain time frame, the handler can avoid ## choking the log with massive amounts of printouts. ## ## This config controls the maximum number of events to handle within ## a time frame. After the limit is reached, successive events are ## dropped until the end of the time frame. ## ## Note that there would be no warning if any messages were ## dropped because of burst control. ## ## Comment this config out to disable the burst control feature. ## ## Value: MaxBurstCount,TimeWindow ## Default: disabled ## #log.burst_limit = 20000, 1s