Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] PD, Store process log files do not scroll #2581

Closed
1 task done
haohao0103 opened this issue Jul 12, 2024 · 1 comment · Fixed by #2589
Closed
1 task done

[Bug] PD, Store process log files do not scroll #2581

haohao0103 opened this issue Jul 12, 2024 · 1 comment · Fixed by #2589
Labels
bug Something isn't working pd PD module store Store module

Comments

@haohao0103
Copy link
Contributor

haohao0103 commented Jul 12, 2024

Bug Type (问题类型)

None

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.5.0 (Apache Release Version)
  • Backend: RocksDB 5 nodes, SSD
  • OS: Linux

Expected & Actual behavior (期望与实际表现)

start-hugegraph-pd.sh
image

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

@haohao0103 haohao0103 added the bug Something isn't working label Jul 12, 2024
@dosubot dosubot bot added pd PD module store Store module labels Jul 12, 2024
Copy link

dosubot bot commented Jul 12, 2024

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.

haohao0103 added a commit to haohao0103/incubator-hugegraph that referenced this issue Jul 12, 2024
PD, Store process log files do not scroll
haohao0103 added a commit to haohao0103/incubator-hugegraph that referenced this issue Jul 15, 2024
GRPC Java defaults to using java. til.logging (JUL) as the logging framework. In order to print logs using log4j2.xml configuration rules, the dependency Bridge from JUL to Log4j is used
@imbajin imbajin closed this as completed in 24ebe9d Aug 2, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in HugeGraph PD-Store Tasks Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pd PD module store Store module
Projects
Status: Done
1 participant