Skip to content

feature request: save log to local file #7

@phatpaul

Description

@phatpaul

I would love to see an option to save the logs to a local file (i.e. using VFS), so the logs are actually written to an internal filesystem such as FAT, SPIFFS, LittleFS, etc

How do you retrieve the logging that is written to a local file?

I think it should be left up to the application to provide the method to both write to the file and for the user to retrieve the file(s).

I.e. it could be stored on a SD card and the card removed to retrieve the file.
Or store it to internal flash and download it from an embedded HTTP server. I.e. GET http://192.168.4.1/internalfs/syslog.txt

A modular approach would have this component only provide the core functionality and an API for the application to extend. Then several example projects can demonstrate a few implementations. I could provide an example project that makes the file stored to embedded flash (i.e. FAT) partition and make it available to download via an embedded HTTP server.

Perhaps a useful feature for the core component would be to manage the log file rotation. I.e. how many log files are allowed to be kept, how large a single file can become, and the file naming convention.
I would also like to be able to tee or split (clone) the log to multiple sinks. I.e. it goes to the UART, and is available to stream via one of the supported streaming protocols, and is also written to local file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions