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

feat(dist): support auto reload config & compress audit log #1492

Merged
merged 6 commits into from
Jun 18, 2021

Conversation

imbajin
Copy link
Member

@imbajin imbajin commented Jun 8, 2021

Also enhance:

  • add time strategy to avoid old logs overwriting by current logs
  • auto create log folder if it does not exist
  • auto delete log by some conditions (e.g: lastModify + fileSize + filecount)
  • add some comment for auth config

The effect of configs like this: (audit log will compressed by exceeding 1day or 200MB, if we choose hour as basic file pattern, it will compressed by 1hour)

image

based on hour like this:

image

The diff between old & new log format:
image

TODO: after current log4j2.xml stable, then change other configs together

@imbajin imbajin requested review from Linary and javeme June 8, 2021 11:19
@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #1492 (95113e4) into master (461948e) will decrease coverage by 2.84%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1492      +/-   ##
============================================
- Coverage     63.63%   60.79%   -2.85%     
+ Complexity     5863      527    -5336     
============================================
  Files           381      423      +42     
  Lines         32190    35051    +2861     
  Branches       4506     4967     +461     
============================================
+ Hits          20484    21309     +825     
- Misses         9608    11599    +1991     
- Partials       2098     2143      +45     
Impacted Files Coverage Δ
...in/java/com/baidu/hugegraph/api/graph/EdgeAPI.java 53.36% <0.00%> (-0.85%) ⬇️
...u/hugegraph/backend/store/hbase/HbaseSessions.java 57.87% <0.00%> (-0.85%) ⬇️
.../baidu/hugegraph/backend/store/ram/IntLongMap.java 58.82% <0.00%> (-0.56%) ⬇️
...java/com/baidu/hugegraph/structure/HugeVertex.java 78.77% <0.00%> (-0.04%) ⬇️
...e/src/main/java/com/baidu/hugegraph/HugeGraph.java 65.30% <0.00%> (ø)
...n/java/com/baidu/hugegraph/version/ApiVersion.java 75.00% <0.00%> (ø)
...in/java/com/baidu/hugegraph/StandardHugeGraph.java 68.45% <0.00%> (ø)
...n/java/com/baidu/hugegraph/structure/HugeEdge.java 76.49% <0.00%> (ø)
...ava/com/baidu/hugegraph/api/profile/GraphsAPI.java 0.00% <0.00%> (ø)
...ava/com/baidu/hugegraph/metrics/MetricsModule.java 77.67% <0.00%> (ø)
... and 81 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 461948e...95113e4. Read the comment docs.

Also enhance:
- add time strategy to avoid old logs overwriting by current logs
- auto create log folder if it does not exist
- add some comment for auth config
<appenders>
<Console name="console" target="SYSTEM_OUT">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} %-5r [%t] [%-5p] %c %x - %m%n"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current log format like this:
image

removed items:

  • cpu time of current thread
  • fixed 5 length (useless)
  • useless %x (almost)
  • full class format --> shortly format

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Linary
Linary previously approved these changes Jun 16, 2021
<appenders>
<Console name="console" target="SYSTEM_OUT">
<ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} %-5r [%t] [%-5p] %c %x - %m%n"/>
<PatternLayout pattern="%-d{yyyy-MM-dd HH:mm:ss} [%t] [%p] %c{1.} - %m%n"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Linary Linary merged commit fceaaa2 into master Jun 18, 2021
@Linary Linary deleted the auto-reload-config branch June 18, 2021 11:36
imbajin added a commit that referenced this pull request Jun 22, 2021
Also enhance:
- add time strategy to avoid old logs overwriting by current logs
- auto create log folder if it does not exist
- add some comment for auth config

* use strict mode for config property & separate rest configs
* reduce log format length
* Update rest-server.properties
* update all configs (TODO: push to other modules)
imbajin added a commit that referenced this pull request Jun 22, 2021
Also enhance:
- add time strategy to avoid old logs overwriting by current logs
- auto create log folder if it does not exist
- add some comment for auth config

* use strict mode for config property & separate rest configs
* reduce log format length
* Update rest-server.properties
* update all configs (TODO: push to other modules)
jadepeng pushed a commit to jadepeng/hugegraph that referenced this pull request Jun 25, 2021
)

Also enhance:
- add time strategy to avoid old logs overwriting by current logs
- auto create log folder if it does not exist
- add some comment for auth config

* use strict mode for config property & separate rest configs
* reduce log format length
* Update rest-server.properties
* update all configs (TODO: push to other modules)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants