mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-02 11:43:40 +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 (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/eosswedenorg/thalos/app/log"
|
||||||
|
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
|
|
||||||
|
|
@ -34,6 +37,8 @@ type Config struct {
|
||||||
Ship ShipConfig `yaml:"ship"`
|
Ship ShipConfig `yaml:"ship"`
|
||||||
Api string `yaml:"api"`
|
Api string `yaml:"api"`
|
||||||
|
|
||||||
|
Log log.Config `yaml:"log"`
|
||||||
|
|
||||||
Redis RedisConfig `yaml:"redis"`
|
Redis RedisConfig `yaml:"redis"`
|
||||||
MessageCodec string `yaml:"message_codec"`
|
MessageCodec string `yaml:"message_codec"`
|
||||||
|
|
||||||
|
|
@ -43,6 +48,10 @@ type Config struct {
|
||||||
func Parse(data []byte) (*Config, error) {
|
func Parse(data []byte) (*Config, error) {
|
||||||
cfg := Config{
|
cfg := Config{
|
||||||
MessageCodec: "json",
|
MessageCodec: "json",
|
||||||
|
Log: log.Config{
|
||||||
|
MaxFileSize: 10 * 1000 * 1000, // 10 mb
|
||||||
|
MaxTime: time.Hour * 24,
|
||||||
|
},
|
||||||
Ship: ShipConfig{
|
Ship: ShipConfig{
|
||||||
StartBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
StartBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
||||||
EndBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
EndBlockNum: shipclient.NULL_BLOCK_NUMBER,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,13 @@ name: "ship-reader-1"
|
||||||
api: "http://127.0.0.1:8080"
|
api: "http://127.0.0.1:8080"
|
||||||
message_codec: "json"
|
message_codec: "json"
|
||||||
|
|
||||||
|
log:
|
||||||
|
filename: thalos.log
|
||||||
|
directory: logs
|
||||||
|
time_format: 2006-01-02_150405
|
||||||
|
max_filesize: 200mb
|
||||||
|
max_time: 24h
|
||||||
|
|
||||||
ship:
|
ship:
|
||||||
url: "ws://127.0.0.1:8089"
|
url: "ws://127.0.0.1:8089"
|
||||||
irreversible_only: false
|
irreversible_only: false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue