Skip to content

Commit

Permalink
Persist and archive historical logs (halo-dev#3021)
Browse files Browse the repository at this point in the history
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.1.x

#### What this PR does / why we need it:

Provide a default configuration for logging system. Default log filename is `${halo.work-dir}/logs/halo.log`.

References:
- https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.logging.file-output
- https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.logging.file-rotation

#### Which issue(s) this PR fixes:

Fixes halo-dev#2968

#### Special notes for your reviewer:

Start Halo and check the log file `${halo.work-dir}/logs/halo.log`.

#### Does this PR introduce a user-facing change?

```release-note
持久化并归档历史日志
```
  • Loading branch information
JohnNiang authored Dec 21, 2022
1 parent 082aa30 commit 77da761
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ halo:
springdoc:
api-docs:
enabled: false

logging:
file:
name: ${halo.work-dir}/logs/halo.log
logback:
rollingpolicy:
max-file-size: 10MB
total-size-cap: 1GB
max-history: 0

0 comments on commit 77da761

Please sign in to comment.