logging

FileNotFoundError on Heroku after creating that file

戏子无情 提交于 2021-01-29 22:34:18
问题 My app has some additional logging, it works fine on a local machine and even on Heroku local. When I push it to Heroku, it raises a FileNotFoundError . Here is my code: class Logger: def __init__(self, name, file_handler, formatter, stream_handler): if not os.path.exists('Logs'): os.makedirs('Logs') self.logger = logging.getLogger(name) self.logger.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) self.logger.addHandler(file_handler) if stream_handler: stream_handler = logging

FileNotFoundError on Heroku after creating that file

送分小仙女□ 提交于 2021-01-29 22:30:41
问题 My app has some additional logging, it works fine on a local machine and even on Heroku local. When I push it to Heroku, it raises a FileNotFoundError . Here is my code: class Logger: def __init__(self, name, file_handler, formatter, stream_handler): if not os.path.exists('Logs'): os.makedirs('Logs') self.logger = logging.getLogger(name) self.logger.setLevel(logging.DEBUG) file_handler.setFormatter(formatter) self.logger.addHandler(file_handler) if stream_handler: stream_handler = logging

slf4j does not find log4j2 jars

旧时模样 提交于 2021-01-29 21:55:09
问题 I know it should be easy to use SLF4J with Log4j2 as logger implementation. You just need to add the jars to the classpath. I have thought that I did so, but I am still getting INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. SLF4J: Failed to load class "org.slf4j.impl

Can't see traceId and spanId in log for Sleuth

梦想与她 提交于 2021-01-29 19:41:48
问题 I've started learning Sleuth and I'm stuck at logging config. I have this config: <?xml version="1.0" encoding="UTF-8"?> <configuration> <include resource="org/springframework/boot/logging/logback/defaults.xml"/> ​ <springProperty scope="context" name="springAppName" source="spring.application.name"/> <!-- Example for logging into the build folder of your project --> <property name="LOG_FILE" value="C://tmp//test"/>​ <property name="CONSOLE_LOG_PATTERN" value="%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}

Sending logs from .net core application running in App Service to log analytics

帅比萌擦擦* 提交于 2021-01-29 19:28:01
问题 I tried looking for the simplest way of my .net core 2.0 application to send app logs to log analytics workspace. This application is running under App Service in azure, and I tried enabling the "Diagnostic Settings" and archiving the logs to log analytics. However, I am not seeing my app custom logs messages in: AppServiceHTTPLogs . I have used the following guide: https://azure.github.io/AppService/2019/11/01/App-Service-Integration-with-Azure-Monitor.html My application is using

What does MinimumLevel and Override mean in appsettings.json logging context?

寵の児 提交于 2021-01-29 19:13:48
问题 I am looking at the appsettings.json from Serilog sample project, which has the following snippet: "MinimumLevel": { "Default": "Debug", "Override": { "System": "Information", "Microsoft": "Information" } } In this context, what is the purpose of Override ? The System and Microsoft entries don't have a parent setting in the MinimumLevel node, so what is it overriding? Unless I am completely misunderstanding the purpose of Override . 回答1: By default, you're saying any log entry that is

Log file not getting generated from dependent JAR application

拜拜、爱过 提交于 2021-01-29 17:52:18
问题 I have a maven application which generates a JAR and used Apache logging in it. When I ran the JAR standalone, log file is getting generated successfully. Now using this JAR file as dependent in another Maven Spring web application, in which the JAR file classes are consumed. But while running the application, could see that only WAR file logs are getting generated and not the dependent JAR log files. Is this the expected behaviour? or am I missing any configuration etc ? Thanks. 回答1: Have

Can't see traceId and spanId in log for Sleuth

北战南征 提交于 2021-01-29 15:11:48
问题 I've started learning Sleuth and I'm stuck at logging config. I have this config: <?xml version="1.0" encoding="UTF-8"?> <configuration> <include resource="org/springframework/boot/logging/logback/defaults.xml"/> ​ <springProperty scope="context" name="springAppName" source="spring.application.name"/> <!-- Example for logging into the build folder of your project --> <property name="LOG_FILE" value="C://tmp//test"/>​ <property name="CONSOLE_LOG_PATTERN" value="%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}

How to pass logger into SignalR hub on server side in ASP.NET Core application

怎甘沉沦 提交于 2021-01-29 11:37:27
问题 I have ASP.NET Core application with React client. I have SignalR messaging between server and client. I have the following code on server side: Startup.cs ... public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseSignalR(routes => { routes.MapHub<ChatHub>("/signalr"); }); } ... Question: Could I pass logger to ChatHub from Startup.cs as I do it with another services like this: Startup.cs private readonly ILogger _log; public Startup(IHostingEnvironment env, ILogger

Create new log file for everyday using python logging

ε祈祈猫儿з 提交于 2021-01-29 10:13:36
问题 My python code works fine to create a log file with name and date on which code was executed - For example- I run code today it will create log file - logfile_2020-01-15.log I run code tomorrow it will create log file - logfile_2020-01-16.log and so on. Now the concern is, if my code execution is started today and it keeps on running for 8 days. It should create 8 log files - 1 file each day: logfile_2020-01-15.log to logfile_2020-01-23.log But this is not happening. It keeps on logging in