How to log cron jobs?

* * * * * myjob.sh >> /var/log/myjob.log 2>&1 will log all output from the cron job to /var/log/myjob.log You might use mail to send emails. Most systems will send unhandled cron job output by email to root or the corresponding user.

Good examples using java.util.logging [closed]

java.util.logging keeps you from having to tote one more jar file around with your application, and it works well with a good Formatter. In general, at the top of every class, you should have: private static final Logger LOGGER = Logger.getLogger( ClassName.class.getName() ); Then, you can just use various facilities of the Logger class. Use … Read more

How to enable MySQL Query Log?

First, Remember that this logfile can grow very large on a busy server. For mysql < 5.1.29: To enable the query log, put this in /etc/my.cnf in the [mysqld] section log = /path/to/query.log #works for mysql < 5.1.29 Also, to enable it from MySQL console SET general_log = 1; See http://dev.mysql.com/doc/refman/5.1/en/query-log.html For mysql 5.1.29+ With … Read more

Logging best practices [closed]

Update: For extensions to System.Diagnostics, providing some of the missing listeners you might want, see Essential.Diagnostics on CodePlex (http://essentialdiagnostics.codeplex.com/) Frameworks Q: What frameworks do you use? A: System.Diagnostics.TraceSource, built in to .NET 2.0. It provides powerful, flexible, high performance logging for applications, however many developers are not aware of its capabilities and do not make … Read more

Log all queries in mysql

(Note: For mysql-5.6+ this won’t work. There’s a solution that applies to mysql-5.6+ if you scroll down or click here.) If you don’t want or cannot restart the MySQL server you can proceed like this on your running server: Create your log tables on the mysql database CREATE TABLE `slow_log` ( `start_time` timestamp NOT NULL … Read more

Spring Boot – How to log all requests and responses with exceptions in single place?

Don’t write any Interceptors, Filters, Components, Aspects, etc., this is a very common problem and has been solved many times over. Spring Boot has a modules called Actuator, which provides HTTP request logging out of the box. There’s an endpoint mapped to /trace (SB1.x) or /actuator/httptrace (SB2.0+) which will show you last 100 HTTP requests. … Read more

Most useful NLog configurations [closed]

Some of these fall into the category of general NLog (or logging) tips rather than strictly configuration suggestions. Here are some general logging links from here at SO (you might have seen some or all of these already): log4net vs. Nlog Logging best practices What’s the point of a logging facade? Why do loggers recommend … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)