If you’re drowning in config, try `loguru`. It’s like logging but without the headache.
But if you *must* use python logging dictconfig json, here’s a minimal file handler setup:
```json
{
"version": 1,
"handlers": {
"file": {
"class": "logging.FileHandler",
"filename": "app.log",
"formatter": "basic"
}
},
"formatters": {
"basic": {
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
}
},
"root": {
"handlers": ["file"],
"level": "INFO"
}
}
```
Save it, load it, and you’re golden.
But if you *must* use python logging dictconfig json, here’s a minimal file handler setup:
```json
{
"version": 1,
"handlers": {
"file": {
"class": "logging.FileHandler",
"filename": "app.log",
"formatter": "basic"
}
},
"formatters": {
"basic": {
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
}
},
"root": {
"handlers": ["file"],
"level": "INFO"
}
}
```
Save it, load it, and you’re golden.
