Swiftpack.co -  jabwd/serilog as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
jabwd/serilog
Basic swift-log backend for Seq
.package(url: "https://github.com/jabwd/serilog.git", from: "0.2.0")

Serilog

A simple logging implementation for Serilog users.

Installation

Add the following line to your dependencies in your Package.swift

.package(name: "serilog", url: "https://github.com/jabwd/serilog", from: "0.2.0"),

Example usage with Vapor:

var env = try Environment.detect()
let provider = SeqProvider()
LoggingSystem.bootstrap(provider.createNew)

let app = Application(env)
defer { app.shutdown() }

let seqIngestURL = URL(string: Environment.get("SEQ_API_URL")!)!
let seqCfg = SeqConfiguration(key: Environment.get("SEQ_API_KEY")!, ingestURL: seqIngestURL)
provider.eventLoopGroup = app.eventLoopGroup
provider.configuration = seqCfg
provider.startLogging()

Adding default metadata to every log entry

let loggerMetadata: Logger.Metadata = [
  "Application": "Serilog test client"
]
LoggingSystem.bootstrap { label in
  provider.createNew(label: label, metadata: loggerMetadata)
}

GitHub

link
Stars: 0
Last commit: 6 days ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics