Skip to content

Commit 2ff3dae

Browse files
committed
Update logging related doc
1 parent 5d6437f commit 2ff3dae

2 files changed

Lines changed: 40 additions & 36 deletions

File tree

docs/img/log_console.png

19.9 KB
Loading

docs/usage/Logging.md

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,97 +2,101 @@
22

33
### Log location
44

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.
5+
- Console: From the Console, select "View" > "Output" and then from the OUTPUT panel, select "Rocket MV BASIC Language Server" from the Tasks drop-down.
6+
7+
![](../img/log_console.png)
8+
9+
**Note**: If there is no warning or above level logs generated, then there is no Console output.
710

8-
- Log file: .rmv -> logs -> MVVS_all.log
11+
- Log file: .rmv\logs\rocket_mv_basic_language_server.log
912

1013
### Log config
1114

12-
- Config file location: .rmv -> config -> log4j2.properties
15+
- Config file location: .rmv\config\log4j2.properties
1316

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:
17+
- The Extension uses the **log4j2** component. If you already know log4j2, it will be easy to configure the log. You can find related settings in log4j2 official online documentation here: https://logging.apache.org/log4j/2.x/manual/configuration.html . The following are brief description of commonly used options for your reference.
1518

1619
#### property
1720

18-
The most commonly used configuration properties. In most cases, you will only need to change these properties:
21+
In most cases, you will only need to change these properties:
1922

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".
23+
- 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 conditions will be printed. Recommended value is "Info".
2124

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".
25+
- property.CONSOLE_LEVEL: Used to configure the "appender.console.filter.threshold.level". Limits the log level of output to the console. Recommended value is "Warn".
2326

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".
27+
- property.FILE_LEVEL: Used to configure the "appender.all.filter.threshold.level". Limits the log level of output to the file. Recommended value is "trace".
2528

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".
29+
- property.SERVER_NAME: Used to configure the log output file name. We recommend that this value not be changed. Recommended value is "rocket_mv_basic_language_server".
2730

28-
- property.LOG_HOME: Used to configure the log output file home path. Reference value is ".rmv/logs".
31+
- property.LOG_HOME: Used to configure the log output file home path. Recommended value is ".rmv/logs".
2932

3033
#### global configuration
3134

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".
35+
- status: The level of internal Log4j events that should be logged to the console. We recommend that this value not be changed. Recommended value is "error".
36+
37+
- monitorInterval: The minimum amount of time, in seconds, before the file configuration is checked for changes. Recommended value is "5" seconds.
3438

3539
#### rootLogger
3640

37-
Set the level and zero or more appender refs to create for that logger.
41+
Set the rootLogger level and where to place the log file. In addition, you can create appender refs for the logger .
3842

39-
- rootLogger.level: logger level. Reference value is "Info"
43+
- rootLogger.level: logger level. Recommended value is "Info"
4044

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".
45+
- rootLogger.appenderRef.console.ref: This value is identical to the value of appender.console.name. We recommend that this value not be changed. Recommended value is "ConsoleAll".
4246

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".
47+
- rootLogger.appenderRef.all.ref: This value is identical to the value of appender.file.name. We recommend that this value not be changed. Recommended value is "RollingFileAll".
4448

4549
#### appender.console
4650

47-
Appender used to define output to the console
51+
Appender used to define output to the console:
4852

49-
- appender.console.type: Fixed value. Reference value is "Console".
53+
- appender.console.type: Suggest not to change. Recommended value is "Console".
5054

51-
- appender.console.name: We recommend that this value not be changed. Reference value is "ConsoleAll".
55+
- appender.console.name: Suggest not to change. Recommended value is "ConsoleAll".
5256

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".
57+
- appender.console.target: SYSTEM_OUT or SYSTEM_ERR, please only use SYSTEM_ERR here. Because SYSTEM_OUT may cause unexpected error.
5458

55-
- appender.console.layout.type: Includes "JSONLayout", "HTMLLayout", "YMLLayout" and so on. Recommended value is PatternLayout. Reference value is "PatternLayout".
59+
- appender.console.layout.type: Includes "JSONLayout", "HTMLLayout", "YMLLayout" and so on. Recommended value is PatternLayout. Recommended value is "PatternLayout".
5660

57-
- appender.console.layout.pattern: output format. Reference value is "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
61+
- appender.console.layout.pattern: output format. Recommended value is "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
5862

59-
- appender.console.filter.threshold.level: Refer to "property.CONSOLE_LEVEL". Fixed value, "${CONSOLE_LEVEL}".
63+
- appender.console.filter.threshold.level: Refer to "property.CONSOLE_LEVEL". Suggest not to change, "${CONSOLE_LEVEL}".
6064

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
65+
- appender.console.filter.threshold.type: Includes "StringMatchFilter", "LevelRangFilter","RegexFilter" and so on. Recommended value is "ThresholdFilter", output log information when log level >= CONSOLE_LEVEL
6266

6367
#### appender.file
6468

6569
Appender used to define output to the file
6670

67-
- appender.file.type: Fixed value. Reference value is "RollingFile".
71+
- appender.file.type: Suggest not to change. Recommended value is "RollingFile".
6872

69-
- appender.file.name: We recommend that this value not be changed. Reference value is "RollingFileAll".
73+
- appender.file.name: Suggest not to change. Recommended value is "RollingFileAll".
7074

7175
- appender.file.filter.threshold.level: Refer to "property.FILE_LEVEL". Fixed value, "${FILE_LEVEL}".
7276

73-
- appender.file.filter.threshold.type=ThresholdFilter: Refer to "appender.console.filter.threshold.type".
77+
- appender.file.filter.threshold.type: Refer to "appender.console.filter.threshold.type".
7478

75-
- appender.file.fileName: Log file absolute path. Reference value is "${LOG_HOME}/${SERVER_NAME}.log"
79+
- appender.file.fileName: Log file absolute path. Recommended value is "${LOG_HOME}/${SERVER_NAME}.log"
7680

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".
81+
- appender.file.filePattern: file name format. Don't delete "%i" because it is related to "DefaultRolloverStrategy" (unless modify "DefaultRolloverStrategy" to another strategy). Recommended value is "${LOG_HOME}/backup/${SERVER_NAME}.%d{yyyy-MM-dd}-%i.log".
7882

7983
- appender.file.layout.type: Refer to "appender.console.layout.type".
8084

81-
- appender.file.layout.pattern: output format. Reference value is "%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n".
85+
- appender.file.layout.pattern: output format. Recommended value is "%d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n".
8286

8387
- appender.file.policies.type: Specifies a strategy for scrolling logs. Fixed value, "Policies".
8488

8589
- appender.file.policies.time.type: Child of Policies with value fixed to "TimeBasedTriggeringPolicy". Time-based rolling strategy.
8690

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".
91+
- appender.file.policies.time.interval: Recommended value is "1".
8892

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".
93+
- appender.file.policies.time.modulate: Indicates whether to adjust the time interval so that the next rollover occurs at the interval boundary. Recommended value is "true".
9094

9195
- appender.file.policies.size.type: Child of Policies with a fixed value of "SizeBasedTriggeringPolicy". The scroll policy based on file size.
9296

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".
97+
- 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. Recommended value is "10M".
9498

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.
99+
- appender.file.strategy.type: Suggest not to change, "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 in backup file path.
96100

97101
### Examples
98102

@@ -108,7 +112,7 @@ To set the log file level output to info level or higher., you only need to chan
108112

109113
**Example 2**
110114

111-
Set the console output information to debug level or higher and set the , log file output information to info level or higher:
115+
Set the console output information to debug level or higher and set the log file output information to info level or higher:
112116

113117
- property.ROOT_LEVEL=Debug
114118

0 commit comments

Comments
 (0)