[Misc] add structure logging, write to file and log tracing for SGL Router
This commit is contained in:
@@ -67,6 +67,20 @@ $ pip install -e .
|
||||
|
||||
**Note:** When modifying Rust code, you must rebuild the wheel for changes to take effect.
|
||||
|
||||
### Logging
|
||||
|
||||
The SGL Router includes structured logging with console output by default. To enable log files:
|
||||
|
||||
```python
|
||||
# Enable file logging when creating a router
|
||||
router = Router(
|
||||
worker_urls=["http://worker1:8000", "http://worker2:8000"],
|
||||
log_dir="./logs" # Daily log files will be created here
|
||||
)
|
||||
```
|
||||
|
||||
Use the `--verbose` flag with the CLI for more detailed logs.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
1. If rust analyzer is not working in VSCode, set `rust-analyzer.linkedProjects` to the absolute path of `Cargo.toml` in your repo. For example:
|
||||
|
||||
Reference in New Issue
Block a user