1# Copyright (c) 2021 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4config LOG_BACKEND_FS
5	bool "File system backend"
6	depends on FILE_SYSTEM
7	select LOG_OUTPUT
8	help
9	  When enabled, backend is using the configured file system to output logs.
10	  As the file system must be mounted for the logging to work, it must be
11	  either configured for auto-mount or manually mounted by the application.
12	  Log messages are discarded as long as the file system is not mounted.
13
14if LOG_BACKEND_FS
15
16backend = FS
17backend-str = fs
18source "subsys/logging/Kconfig.template.log_format_config"
19
20config LOG_BACKEND_FS_AUTOSTART
21	bool "Automatically start fs backend"
22	default y
23	help
24	  When enabled automatically start the file system backend on
25	  application start.
26
27config LOG_BACKEND_FS_OVERWRITE
28	bool "Old log files overwrite"
29	default y
30	help
31	  When enabled backend overwrites oldest log files.
32	  In other case, when memory is full, new messages are dropped.
33
34config LOG_BACKEND_FS_FILE_PREFIX
35	string "Log file name prefix"
36	default "log."
37	help
38	  User defined name of log files saved in the file system.
39	  The prefix is followed by the number of log file.
40
41config LOG_BACKEND_FS_DIR
42	string "Log directory"
43	default "/lfs1"
44	help
45	  Directory to which log files will be written.
46
47config LOG_BACKEND_FS_FILE_SIZE
48	int "User defined log file size"
49	default 4096
50	range 128 1073741824
51	help
52	  Max log file size (in bytes).
53
54config LOG_BACKEND_FS_FILES_LIMIT
55	int "Max number of files containing logs"
56	default 10
57	help
58	  Limit of number of files with logs. It is also limited by
59	  size of file system partition.
60
61endif # LOG_BACKEND_FS
62