mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-13 11:35:40 +01:00
Rolling log file location (#1846)
* Rolling log file location * Fix file name
This commit is contained in:
parent
b5a40035ce
commit
29e380856b
3 changed files with 13 additions and 5 deletions
|
@ -24,7 +24,16 @@
|
|||
</appender>
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||
<file>${bitcoins.log.location}</file>
|
||||
<file>${bitcoins.log.location}/bitcoin-s.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!-- hourly rollover -->
|
||||
<fileNamePattern>${bitcoins.log.location}/logs/bitcoin-s-%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
|
||||
|
||||
<!-- each file should be at most 100MB, keep 2 days of history, and at most 2GB in the archive -->
|
||||
<maxFileSize>100MB</maxFileSize>
|
||||
<maxHistory>48</maxHistory>
|
||||
<totalSizeCap>2GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>%date{yyyy-MM-dd'T'HH:mm:ss,SSXXX} %level [%logger{0}] %msg%n</pattern>
|
||||
</encoder>
|
||||
|
|
|
@ -76,8 +76,7 @@ object Main extends App with BitcoinSLogger {
|
|||
datadirPath.resolve(lastDirname)
|
||||
}
|
||||
|
||||
System.setProperty("bitcoins.log.location",
|
||||
datadir.resolve("bitcoin-s.log").toAbsolutePath.toString)
|
||||
System.setProperty("bitcoins.log.location", datadir.toAbsolutePath.toString)
|
||||
|
||||
implicit val system: ActorSystem = ActorSystem("bitcoin-s", baseConfig)
|
||||
implicit val ec: ExecutionContext = system.dispatcher
|
||||
|
|
|
@ -161,8 +161,8 @@ abstract class AppConfig extends LoggerConfig with StartStopAsync[Unit] {
|
|||
baseDatadir.resolve(lastDirname)
|
||||
}
|
||||
|
||||
override val logFile: Path = {
|
||||
val path = datadir.resolve("bitcoin-s.log")
|
||||
override val logLocation: Path = {
|
||||
val path = datadir
|
||||
// Set property for loggers
|
||||
System.setProperty("bitcoins.log.location", path.toAbsolutePath.toString)
|
||||
path
|
||||
|
|
Loading…
Add table
Reference in a new issue