Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Logging Features: Syslog and Restful Support #1387

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

mdaneri
Copy link
Contributor

@mdaneri mdaneri commented Sep 8, 2024

Recovered from #1335

Description:

This PR introduces new features to the Pode logging system, adding support for Syslog and Restful logging methods. The following new functions have been added:

  • 'Enable-PodeGeneralLogging'
  • 'Enable-PodeTraceLogging'
  • 'Disable-PodeGeneralLogging'
  • 'Disable-PodeTraceLogging'
  • 'Enable-PodeLogging'
  • 'Disable-PodeLogging'
  • 'Clear-PodeLogging'

Additionally,

the New-PodeLoggingMethod function now supports two new type: Syslog and Restful.
Write-PodeLog now has been improved 

New Features:

  • Logging Runspace: Logging now operates in its own runspace for improved performance and isolation.
  • Service Shutdown on Logging Failure: Logging failure can be configured to trigger a service shutdown.
  • Configurable Max Logging Queue Size: A new configurable maximum logging queue size has been introduced, which can trigger an error if the queue size is exceeded.
  • Multiple Logging Output Methods: It is now possible to assign multiple logging output methods to a specific logging configuration.
  • Multiple Log Formats: The Enable-PodeRequestLogging function now supports multiple log formats: 'Extended', 'Common', 'Combined', 'JSON'.
  • Configurable Log Date Format: The log date format is now configurable.
  • Syslog Transport Methods: Syslog support includes TCP, UDP, and TLS transport methods.
  • Switched the internal core structure from using an ArrayList with manual locking to the threadsafe System.Collections.Concurrent.ConcurrentQueue

Here is an example of how to configure multiple logging output methods:

$logging = @(
    (New-PodeLoggingMethod -Terminal),
    (New-PodeLoggingMethod -Syslog -Server 127.0.0.1 -Transport UDP -AsUTC -ISO8601 -FailureAction Report),
    (New-PodeLoggingMethod -File -Name 'requests' -MaxDays 4)
)

$logging | Enable-PodeRequestLogging

@Badgerati Badgerati added this to the 2.12.0 milestone Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants