Skip to content

Commit e65dff1

Browse files
committed
Add logging docs
1 parent c3b3911 commit e65dff1

2 files changed

Lines changed: 115 additions & 0 deletions

File tree

docs/usage/Logging.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
## Log
2+
3+
### Log location
4+
5+
- Console: View -> Output, OUTPUT -> select list -> Rocket MV BASIC Language Server
6+
Log information displays when the extension produces a warning level log by default.
7+
8+
- Log file: .rmv -> logs -> MVVS_all.log
9+
10+
### Log config
11+
12+
- Config file location: .rmv -> config -> log4j2.properties
13+
14+
- The Extension uses the log4j2 component to log. If you already know log4j2, it will be easy to configure the log. The following information includes commonly used options. These can be found here:https://logging.apache.org/log4j/2.x/manual/configuration.html:
15+
16+
#### property
17+
18+
The most commonly used configuration properties. In most cases, you will only need to change these properties:
19+
20+
- property.ROOT_LEVEL: Used to configure the "rootLogger.level". Logger levels include Trace,Debug, Info, Warn, Error, and Fatal. Only logs with levels higher than or equal to the configured level will be available. Root logger level is the first filter. Console or file level is the second filter, Only logs that meet both of these conditions will be printed. Reference value is "Info".
21+
22+
- property.CONSOLE_LEVEL: Used to configure the "appender.console.filter.threshold.level". Limits the log level of output to the console. Reference value is "Warn".
23+
24+
- property.FILE_LEVEL=trace: Used to configure the "appender.all.filter.threshold.level". Limits the log level of output to the file. Reference value is "Trace".
25+
26+
- property.SERVER_NAME: Used to configure the log output file name. We recommend that this value not be changed. Reference value is "rocket_mv_basic_language_server".
27+
28+
- property.LOG_HOME: Used to configure the log output file home path. Reference value is ".rmv/logs".
29+
30+
#### global configuration
31+
32+
- status: The level of internal Log4j events that should be logged to the console. It hardly to help us , We recommend that this value not be changed. Reference value is "error".
33+
- monitorInterval: The minimum amount of time, in seconds, before the file configuration is checked for changes. Reference value is "5".
34+
35+
#### rootLogger
36+
37+
Set the level and zero or more appender refs to create for that logger.
38+
39+
- rootLogger.level: logger level. Reference value is "Info"
40+
41+
- rootLogger.appenderRef.console.ref: This value is identical to the value of appender.console.name. We recommend that this value not be changed. Reference value is "ConsoleAll".
42+
43+
- rootLogger.appenderRef.all.ref: This value is identical to the value of appender.file.name. We recommend that this value not be changed. Reference value is "RollingFileAll".
44+
45+
#### appender.console
46+
47+
Appender used to define output to the console
48+
49+
- appender.console.type: Fixed value. Reference value is "Console".
50+
51+
- appender.console.name: We recommend that this value not be changed. Reference value is "ConsoleAll".
52+
53+
- appender.console.target: SYSTEM_OUT or SYSTEM_ERR. We recommend that you only use SYSTEM_ERR because SYSTEM_OUT will cause an extension run error! Reference value is "SYSTEM_ERR".
54+
55+
- appender.console.layout.type: Includes "JSONLayout", "HTMLLayout", "YMLLayout" and so on. Recommended value is PatternLayout. Reference value is "PatternLayout".
56+
57+
- appender.console.layout.pattern: output format. Reference value is "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
58+
59+
- appender.console.filter.threshold.level: Refer to "property.CONSOLE_LEVEL". Fixed value, "${CONSOLE_LEVEL}".
60+
61+
- appender.console.filter.threshold.type: Includes "StringMatchFilter", "LevelRangFilter","RegexFilter" and so on. Reference value is "ThresholdFilter", output log infomation when log level >= CONSOLE_LEVEL
62+
63+
#### appender.file
64+
65+
Appender used to define output to the file
66+
67+
- appender.file.type: Fixed value. Reference value is "RollingFile".
68+
69+
- appender.file.name: We recommend that this value not be changed. Reference value is "RollingFileAll".
70+
71+
- appender.file.filter.threshold.level: Refer to "property.FILE_LEVEL". Fixed value, "${FILE_LEVEL}".
72+
73+
- appender.file.filter.threshold.type=ThresholdFilter: Refer to "appender.console.filter.threshold.type".
74+
75+
- appender.file.fileName: Log file absolute path. Reference value is "${LOG_HOME}/${SERVER_NAME}.log"
76+
77+
- appender.file.filePattern: file name format. Don't delete "%i" because it is related to "DefaultRolloverStrategy" (unless modify "DefaultRolloverStrategy" to another strategy). Reference value is "${LOG_HOME}/backup/${SERVER_NAME}.%d{yyyy-MM-dd}-%i.log".
78+
79+
- appender.file.layout.type: Refer to "appender.console.layout.type".
80+
81+
- appender.file.layout.pattern: output format. Reference value is "%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n".
82+
83+
- appender.file.policies.type: Specifies a strategy for scrolling logs. Fixed value, "Policies".
84+
85+
- appender.file.policies.time.type: Child of Policies with value fixed to "TimeBasedTriggeringPolicy". Time-based rolling strategy.
86+
87+
- appender.file.policies.time.interval: The interval property specifies how often it is flipped based on the most specific time unit in the date pattern. The month, day, hour, and minute depends on the date format configured in filePattern. Reference value is "1".
88+
89+
- appender.file.policies.time.modulate: Indicates whether to adjust the time interval so that the next rollover occurs at the interval boundary. Reference value is "true".
90+
91+
- appender.file.policies.size.type: Child of Policies with a fixed value of "SizeBasedTriggeringPolicy". The scroll policy based on file size.
92+
93+
- appender.file.policies.size.size: Policies define the size of each log file. The size can be specified in bytes, suffixed with KB, MB or GB. Reference value is "10M".
94+
95+
- appender.file.strategy.type: Fixed value, "DefaultRolloverStrategy". Used to specify the maximum number of log files that can exist in the same folder before the oldest log files are deleted allowing new log files to be created (via the max attribute). The default is to keep a maximum of seven files.
96+
97+
### Examples
98+
99+
1. To set the log file level output to info level or higher., you only need to change log file level to info:
100+
101+
- property.ROOT_LEVEL=Info
102+
- property.CONSOLE_LEVEL=Info
103+
- property.FILE_LEVEL=Info
104+
105+
2. Set the console output information to debug level or higher and set the , log file output information to info level or higher:
106+
107+
- property.ROOT_LEVEL=Debug
108+
- property.CONSOLE_LEVEL=Debug
109+
- property.FILE_LEVEL=Info
110+
111+
3. Change the log file size to 20M
112+
113+
- appender.file.policies.size.size=20M
114+
-

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ nav:
1717
- 'Hover': 'usage/Hover.md'
1818
- 'INCLUDE settings': 'usage/Include.md'
1919
- 'Multiple Workspace Folders': 'usage/MultipleWorkspaceFolders.md'
20+
- 'Logging': 'usage/Logging.md'
2021
- 'References': 'usage/References.md'
2122
- 'Semantic Highlighting': 'usage/SemanticHighlighting.md'
2223
- 'Signature Help': 'usage/SignatureHelp.md'

0 commit comments

Comments
 (0)