mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-16 04:24:56 +02:00
app/config/config.go: add logging config
This commit is contained in:
parent
19a84b77fb
commit
de266da33c
2 changed files with 16 additions and 0 deletions
|
|
@ -2,6 +2,9 @@ package config
|
|||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"time"
|
||||
|
||||
"github.com/eosswedenorg/thalos/app/log"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
|
|
@ -34,6 +37,8 @@ type Config struct {
|
|||
Ship ShipConfig `yaml:"ship"`
|
||||
Api string `yaml:"api"`
|
||||
|
||||
Log log.Config `yaml:"log"`
|
||||
|
||||
Redis RedisConfig `yaml:"redis"`
|
||||
MessageCodec string `yaml:"message_codec"`
|
||||
|
||||
|
|
@ -43,6 +48,10 @@ type Config struct {
|
|||
func Parse(data []byte) (*Config, error) {
|
||||
cfg := Config{
|
||||
MessageCodec: "json",
|
||||
Log: log.Config{
|
||||
MaxFileSize: 10 * 1000 * 1000, // 10 mb
|
||||
MaxTime: time.Hour * 24,
|
||||
},
|
||||
Ship: ShipConfig{
|
||||
StartBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
||||
EndBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@ name: "ship-reader-1"
|
|||
api: "http://127.0.0.1:8080"
|
||||
message_codec: "json"
|
||||
|
||||
log:
|
||||
filename: thalos.log
|
||||
directory: logs
|
||||
time_format: 2006-01-02_150405
|
||||
max_filesize: 200mb
|
||||
max_time: 24h
|
||||
|
||||
ship:
|
||||
url: "ws://127.0.0.1:8089"
|
||||
irreversible_only: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue