Skip to content

New Logging Features: Syslog and Restful Support#1387

Open
mdaneri wants to merge 93 commits intoBadgerati:developfrom
mdaneri:Log-rest-syslog
Open

New Logging Features: Syslog and Restful Support#1387
mdaneri wants to merge 93 commits intoBadgerati:developfrom
mdaneri:Log-rest-syslog

Conversation

@mdaneri
Copy link
Copy Markdown
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

Comment thread src/Public/Authentication.ps1 Fixed
@Badgerati Badgerati added this to the 2.12.0 milestone Sep 29, 2024
@Badgerati Badgerati added the story-points: 8 High complexity. Large features, deep refactors, or security work. Requires extensive review/testing label Feb 22, 2025
@Badgerati Badgerati removed this from the 2.13.0 milestone Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high Target for next release or soon after. A priority but not critical story-points: 8 High complexity. Large features, deep refactors, or security work. Requires extensive review/testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants