日志是一个系统非常重要的一部分,我们经常需要通过查看日志来定位问题,今天我们一起来学习一下Spring Boot的日志系统.有很多同学习惯性的在生产代码中使用System.out来输出日志,这是不推荐的一种做法,因为System.out是一个同步操作,会在一定程度上影响系统性能,而Logger是一个异步操作. Spring Boot默认的日志系统是logback,当然我们并不需要去引用logback的依赖,因为在spring-boot-starter中已经应用了logback的依赖. 一.控制台
mysql的日志文件 日志文件大致分为 error log, binary log, query log, slow query log, innodb redo log ;如图: 1.error log the error log file contains information indicating when mysqld was started and stopped also any critical errors that occur while the server is run
写日志文件是一个很常用的功能,以前都是别人写好的,直接调用的,近期写了一个小工具,因为比较小,所以懒得引用dll文件了,直接上网找了一个,很方便,现在记录下 public class LogClass { /**/ /// <summary> /// 写入日志文件 /// </summary> /// <param name="input"></param> public static void WriteLogFile(string i