Hello everyone,
I need your help because I haven’t found the modification to make on my side.
We have installed Powershell Universal in Docker mode on a Kubernetes platform and we have a problem with the log level.
It’s in information. I’d like to set it to error but I haven’t found the option.
I’ve tried a few things in the settings.ps1 file.
LogLevel = “Error”
MicrosoftLogLevel = “Warning”
NotificationLevel = “Error”
Can you help me?
Thanks in advance
Product: PowerShell Universal
Version: 4.2.7
My understanding is that Kubernetes uses Podman not Docker. Can you confrim this is Docker or is it Podman.
Also, do you have a deployment script with environment variables. I suspect some code will need to be put in there to turn the logging level off.
Yes, you’re right, it is Pod.
I mentioned Docker because it’s the Powershell Universal image that’s used.
ironmansoftware/universal:4.2.7-ubuntu-20.04
https://hub.docker.com/r/ironmansoftware/universal
I set the following environment variable:
{
name = "SystemLogLevel
value = “Error”
}
The information is indeed present in /home/Universal/appsettings.linux.json
root@powershell-universal-5585456fdb-ftl2f:/home# cat Universal/appsettings.linux.json
{
"Kestrel": {
"Endpoints": {
"HTTP": {
"Url": "http://*:5000"
}
},
"RedirectToHttps": "false",
"Hsts": {
"MaxAgeDays": 365
}
},
"Plugins": [
"UniversalAutomation.LiteDBv5"
],
"AllowedHosts": "*",
"SystemLogPath": "%HOME%/PowerShellUniversal/systemLog.txt",
"SystemLogLevel": "Information",
These environment varaibles should do the trick in your yml file:
environment:
- SystemLogPath="%HOME%/PowerShellUniversal/systemLog.txt"
- SystemLogLevel=Information
Thanks
I added the following command to the dockerfile
# Replace SystemLogLevel in appsettings.linux.json
RUN sed -i 's/"SystemLogLevel": "Information"/"SystemLogLevel": "Error"/' /home/Universal/appsettings.linux.json