Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jackfoxy/pslogger
F# Azure logger using table storage
https://github.com/jackfoxy/pslogger
Last synced: about 18 hours ago
JSON representation
F# Azure logger using table storage
- Host: GitHub
- URL: https://github.com/jackfoxy/pslogger
- Owner: jackfoxy
- License: unlicense
- Created: 2017-08-24T19:52:20.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T21:06:47.000Z (almost 2 years ago)
- Last Synced: 2023-03-24T18:37:13.277Z (over 1 year ago)
- Language: F#
- Size: 376 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PSlogger
The logger is a strongly typed system for asynchronous and synchronous logging of program messages from .NET programs to an Azure Table Storage data store,
optimized for useful log querying.# Logging
> The `RunTime` refers to the start time of a workflow. Logs are stored and retrieved using this `RunTime`, not the timestamp of the log message.
> Logs are stored in tables per each day. All logs for a particular workflow are stored in the same table, regardless of how long the workflow takes.## Logging to Azure tables
To log to Azure tables, provide the following environment variables:
- `"loggingType": "azure"`
- `"loggingConnectionString": ""`For local testing, log to the local Azure storage emulator:
- Start the Azure storage emulator locally
- Provide the environment variable: `"loggingConnectionString": "UseDevelopmentStorage=true"`## Log Levels
- `Error`
- `ErrorException`
- `FatalException`
- `Debug`
- `Info`
- `Warning`## Log DateTime Operators
All log DateTime operators are applied to the `RunTime`, i.e. the time when a workflow has begun.
- `Between`: Retrieve logs with a `RunTime` between the `StartDate` and the `EndDate`. `EndDate` is required to use this operator.
- `EQ`: Retrieve logs with a `RunTime` equal to the `StartDate`.
- `LT`: Retrieve logs with a `RunTime` less than the `StartDate`.
- `GT`: Retrieve logs with a `RunTime` greater than the `StartDate`.## Retrieving Logs
Retrieve logs via the endpoint `{url}/logs` by providing a predicate| Parameter | Required | Input | Description |
| ------------- | ---------| ------------------- | --------------- |
| `Customer` | Yes | String | Customer for which to retrieve logs |
| `Operator` | Yes | Log operator | Specifies how to filter the logs over time |
| `StartDate` | Yes | DateTime | The RunTime to which the `Operator` is applied |
| `EndDate` | No | DateTime | Required when `Operator` is `Between` |
| `ProcessName` | No | String | Process (eg, "Optimizations.getFile bdaas-api") for which to retrieve logs |
| `LogLevels` | No | Array of log levels | Log levels for which to retrieve logs |