{"id":38644421,"url":"https://github.com/jcasale/psserilog","last_synced_at":"2026-03-02T03:07:36.469Z","repository":{"id":63148098,"uuid":"534436563","full_name":"jcasale/PSSerilog","owner":"jcasale","description":"A PowerShell module for logging based on the Serilog library.","archived":false,"fork":false,"pushed_at":"2026-02-13T00:20:00.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-13T09:54:48.524Z","etag":null,"topics":["logging","powershell","powershell-modules"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcasale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-09-09T00:06:14.000Z","updated_at":"2026-02-13T00:06:25.000Z","dependencies_parsed_at":"2023-11-10T19:29:41.613Z","dependency_job_id":"ab47b4ce-0e0c-4444-8d27-eb1b080d4dee","html_url":"https://github.com/jcasale/PSSerilog","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/jcasale/PSSerilog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasale%2FPSSerilog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasale%2FPSSerilog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasale%2FPSSerilog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasale%2FPSSerilog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcasale","download_url":"https://codeload.github.com/jcasale/PSSerilog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcasale%2FPSSerilog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","powershell","powershell-modules"],"created_at":"2026-01-17T09:11:46.335Z","updated_at":"2026-03-02T03:07:36.464Z","avatar_url":"https://github.com/jcasale.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerShell Serilog Logging Module\n\nThe `PSSerilog` module provides logging based on the Serilog library.\n\n## Installation\n\nThe module is distributed as a Windows Installer package (the PowerShell Gallery is not suitable for some enterprises).\n\nRun the installer manually or in unattended mode:\n\n```bat\nmsiexec.exe /i ps-serilog.msi /qn\n```\n\nThe default installation path is:\n\n```bat\n%ProgramFiles%\\WindowsPowerShell\\Modules\\PSSerilog\n```\n\n## Documentation\n\nUse `Get-Command` and `Get-Help` to enumerate the cmdlets with this module and obtain their documentation:\n\n```powershell\nGet-Command -Module PSSerilog\nGet-Help New-SerilogLoggerConfiguration -Full\n```\n\n## Examples\n\n- Create a basic logger using a sane pattern:\n\n    ```powershell\n    try\n    {\n        $name = [IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Name)\n        $path = [IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, '.log')\n        $logger = New-SerilogBasicLogger -Name $name -Path $path -ErrorAction Stop\n    }\n    catch\n    {\n        throw\n    }\n\n    function main\n    {\n        [CmdletBinding()]\n        param()\n\n        $logger.Information('Executing script...')\n\n        # Your code follows.\n    }\n\n    try\n    {\n        main -ErrorAction Stop\n    }\n    catch\n    {\n        $logger.Fatal($_.Exception, 'Execution failed.')\n\n        throw\n    }\n    finally\n    {\n        # Call Dispose() here and not Close-SerilogDefaultLogger as the instance was not applied to the static logger.\n        $logger.Dispose()\n    }\n    ```\n\n- Create a basic logger and apply it to the Serilog default static logger:\n\n    ```powershell\n    $name = [IO.Path]::GetFileNameWithoutExtension($MyInvocation.MyCommand.Name)\n    $path = [IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, '.log')\n    $logger = New-SerilogBasicLogger -Name $name -Path $path -ErrorAction Stop |\n        Set-SerilogDefaultLogger -ErrorAction Stop\n\n    try\n    {\n        # The other-script.ps1 can call Get-SerilogDefaultLogger to get a logger configured however necessary.\n        \u0026 \"$PSScriptRoot\\other-script.ps1\"\n    }\n    catch\n    {\n        $logger.Fatal($_.Exception, 'Execution failed.')\n\n        throw\n    }\n    finally\n    {\n        Close-SerilogDefaultLogger\n    }\n    ```\n\n    \u003e **Warning**\n    \u003e Don't call `Set-SerilogDefaultLogger` more than once without calling `Close-SerilogDefaultLogger`.\n\n- Create a custom logger and a global context:\n\n    ```powershell\n    $template = '[{Timestamp:yyyy-MM-dd HH:mm:ss.fff}] [{Level}] [{MyValue}] {Message:l}{NewLine}{Exception}'\n    $configuration = New-SerilogLoggerConfiguration -MinimumLevel Verbose -Properties @{MyValue=42} |\n        Add-SerilogSinkConsole -OutputTemplate $template\n\n    $logger = New-SerilogLogger -Configuration $configuration\n    $logger.Information('Message 1')\n    ```\n\n    Results in:\n\n    ```text\n    [2023-05-28 18:27:07.489] [Information] [42] Message 1\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcasale%2Fpsserilog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcasale%2Fpsserilog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcasale%2Fpsserilog/lists"}