Closed haohao0103 closed 1 month ago
The log file defined by the OUTPUT
variable in the start-hugegraph-pd.sh
script does not scroll according to the rules defined by log4j2.xml
because the OUTPUT
variable is not referenced or used within the log4j2.xml
configuration file. The log4j2 configuration specifies log file paths using the ${LOG_PATH}
and ${FILE_NAME}
properties, but there is no mention of an OUTPUT
variable.
To ensure the log file scrolls according to the rules defined in log4j2.xml
, you need to make sure that the OUTPUT
variable in your script matches the log file paths specified in the log4j2.xml
configuration.
For example, if OUTPUT
is intended to be the main log file, it should match ${LOG_PATH}/${FILE_NAME}.log
:
OUTPUT="logs/hugegraph-pd.log"
Ensure that the script and the log4j2 configuration are aligned in terms of log file paths. The log4j2.xml
configuration uses the following properties for log file paths:
<properties>
<property name="LOG_PATH">logs</property>
<property name="FILE_NAME">hugegraph-pd</property>
</properties>
The main log file is defined as:
<RollingRandomAccessFile name="file" fileName="${LOG_PATH}/${FILE_NAME}.log"
filePattern="${LOG_PATH}/$${date:yyyy-MM}/${FILE_NAME}-%d{yyyy-MM-dd}-%i.log"
bufferedIO="true" bufferSize="524288" immediateFlush="false">
<ThresholdFilter level="TRACE" onMatch="ACCEPT" onMismatch="DENY" />
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n" />
<Policies>
<SizeBasedTriggeringPolicy size="128MB" />
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<DefaultRolloverStrategy max="16">
<Delete basePath="${LOG_PATH}" maxDepth="2">
<IfFileName glob="*/*.log" />
<IfAny>
<IfAccumulatedFileSize exceeds="2GB" />
<IfAccumulatedFileCount exceeds="100" />
</IfAny>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
Make sure the OUTPUT
variable in your script is set to logs/hugegraph-pd.log
to match the log file path defined in log4j2.xml
[1][2].
To continue talking to Dosu, mention @dosu.
Bug Type (问题类型)
None
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
start-hugegraph-pd.sh![image](https://github.com/user-attachments/assets/d94828f2-9054-4447-965c-435788c4e7dd)
The file defined by OUTPUT will not scroll according to the rules defined by log4j2.xml
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response