Persist and archive historical logs (#3021)

#### 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 https://github.com/halo-dev/halo/issues/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
持久化并归档历史日志
```
pull/3031/head
John Niang 2022-12-21 17:56:29 +08:00 committed by GitHub
parent 082aa309f8
commit 77da761a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -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