Tmds.Systemd | .NET Core library for interacting with systemd | DevOps library
kandi X-RAY | Tmds.Systemd Summary
kandi X-RAY | Tmds.Systemd Summary
This package supports .NET Core 2.0+.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Tmds.Systemd
Tmds.Systemd Key Features
Tmds.Systemd Examples and Code Snippets
Community Discussions
Trending Discussions on Tmds.Systemd
QUESTION
My ASP.NET Core 3.1 application used to log to the console only. Now I've added systemd integration. Next I'm using a third-party package to enhance the logging to the journal. The problem is, the application must work both in systemd and in the Windows console for development. If I add both providers, I get duplicate log entries in Linux/systemd.
How can I conditionally select the log provider if systemd was found?
...ANSWER
Answered 2020-Jul-21 at 00:33Sounds like a common way to check is checking if the current process's PID is 1. https://superuser.com/questions/1017959/how-to-know-if-i-am-using-systemd-on-linux
So try checking Process.GetCurrentProcess().Id == 1
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Tmds.Systemd
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page