logging

Windows Phone: Log to console

丶灬走出姿态 提交于 2019-12-29 07:32:09
问题 Disclaimer: I'm quite new to the MSFT tech world and only started Windows Phone development a month or so ago. I am unable to figure out how to log information to the Visual Studio Output window from within a C# and C++ (Direct3D) Windows Phone 8 App. Is this possible? I am building in debug mode, targeting Windows Phone 8, running in the XDE emulator and my development machine is a Windows 8 box with VS2012 Ultimate installed. My App runs fine, my Direct3D scene renders normally, but I can't

ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger

我们两清 提交于 2019-12-29 07:32:06
问题 I was following this answer in order to add a appender on runtime. Even though that works for the original poster, I get this exception in line Logger logger = (Logger) LoggerFactory.getLogger("abc.xyz"); : java.lang.ClassCastException: org.slf4j.impl.Log4jLoggerAdapter cannot be cast to ch.qos.logback.classic.Logger de.mypackage.controller.MyController.meinOeOrte(MyController.java:335) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke

Disable log4j console logging and enable file logging

假装没事ソ 提交于 2019-12-29 07:03:43
问题 My log4j.properties file is: log4j.rootLogger=WARN, stdout, file log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%t] %p [%c] - %m%n log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=${jboss.server.log.dir}/afrodite.log log4j.appender.file.MaxFileSize=10MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.Append=true log4j.appender.file

Disable log4j console logging and enable file logging

喜欢而已 提交于 2019-12-29 07:03:15
问题 My log4j.properties file is: log4j.rootLogger=WARN, stdout, file log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%t] %p [%c] - %m%n log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=${jboss.server.log.dir}/afrodite.log log4j.appender.file.MaxFileSize=10MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.Append=true log4j.appender.file

Disable log4j console logging and enable file logging

China☆狼群 提交于 2019-12-29 07:03:05
问题 My log4j.properties file is: log4j.rootLogger=WARN, stdout, file log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d [%t] %p [%c] - %m%n log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=${jboss.server.log.dir}/afrodite.log log4j.appender.file.MaxFileSize=10MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.Append=true log4j.appender.file

How to dynamically change log level in SLF4j OR Log4J

妖精的绣舞 提交于 2019-12-29 06:43:26
问题 Recently I encountered a situtation where Application Loglevel changes dynamically. Application Admin can set it to INFO/DEBUG/ WARN from front end. Based on the log level choosen be him application logging must be changed. I am sure loggers support this scenario, but not sure how can I achive this. If any of you have idea/thoughts on this please let me know. Thanks in advance for your help. -Narendra 回答1: Consider Logback http://logback.qos.ch/ - "a successor to the popular log4j project,

Powershell command to set IIS logging settings

血红的双手。 提交于 2019-12-29 06:18:33
问题 I'm creating a powershell script so I can create website hosting with a single command using the IIS Powershell Management Console. I have the commands I need to create the IIS Site and add bindings for the domain names etc... The one piece of the puzzle I'm missing though is how to change the default Logging directory from %SystemDrive%\inetpub\logs\LogFiles to my own folder that's not on the boot drive of the server. After extensive searching I expected to find a command along the lines of

Powershell command to set IIS logging settings

非 Y 不嫁゛ 提交于 2019-12-29 06:17:05
问题 I'm creating a powershell script so I can create website hosting with a single command using the IIS Powershell Management Console. I have the commands I need to create the IIS Site and add bindings for the domain names etc... The one piece of the puzzle I'm missing though is how to change the default Logging directory from %SystemDrive%\inetpub\logs\LogFiles to my own folder that's not on the boot drive of the server. After extensive searching I expected to find a command along the lines of

android.util.Log when publishing - what can I do / not do

谁说胖子不能爱 提交于 2019-12-29 04:50:07
问题 I've got a hell of a lot of Log.i Log.d Log.e in my code for a recent app I've done. I'm about to publish this app and I don't really want people seeing it when they plug there phone into adb, but I do want it there for my own debugging. I was wanting to extend android.util.log and just have a boolean switch in there so I could just turn off the log when I publish and turn it on when developing but this class is final, am I missing a trick? I don't really want to go through my code an remove

Multiple filters for one logger with Serilog

天涯浪子 提交于 2019-12-29 04:48:09
问题 I am trying to setup Serilog with my ASP.NET Core application. I'd like to have one log file for all controllers, one for all services, one for the rest and ideally one which contains everything. Every controller is inheriting BaseController and every service BaseService . The controller and the service I am calling are writing a trace log event. The logger and the service are retrieved via dependy injection. The service looks like the controller (regarding the logger). public class