go logs
安装导入
go get github.com/astaxie/beego/logs
import "github.com/astaxie/beego/logs"
使用
package main import (
"encoding/json"
"fmt"
"github.com/astaxie/beego/logs"
) func main() {
config := make(map[string]interface{})
config["filename"] = "./logs/logcollect.log"
config["level"] = logs.LevelDebug configStr, err := json.Marshal(config)
if err != nil {
fmt.Println("marshal failed, err:", err)
return
} logs.SetLogger(logs.AdapterFile, string(configStr)) logs.Debug("this is a test, my name is %s", "stu01")
logs.Trace("this is a trace, my name is %s", "stu02")
logs.Warn("this is a warn, my name is %s", "stu03")
}
go logs的更多相关文章
- 微软发布TX(LINQ To Logs And Traces)
微软开源技术公司于发布了Tx,这是一个Apache 2协议的开源项目,可以使用日志/跟踪文件辅助调试,以及创建实时监控和告警系统. 下面是几个引人关注的功能-- 允许在原始事件源上使用LINQ 允许在 ...
- CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
今天,在用icinga服务器端测试客户端脚本时,报如下错误: [root@mysql-server1 etc]# /usr/local/icinga/libexec/check_nrpe -H 192 ...
- Android Gradle Build Error:Some file crunching failed, see logs for details解决办法
转载请标明出处: http://www.cnblogs.com/why168888/p/5925756.html 本文出自:[Edwin博客园] 错误日志:Error:java.lang.Runtim ...
- MS SQL错误:SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems
早晨宁波那边的IT人员打电话告知数据库无法访问了.其实我在早晨也发现Ignite监控下的宁波的数据库服务器出现了异常,但是当时正在检查查看其它服务器发过来的各类邮件,还没等到我去确认具体情 ...
- 屏蔽zencart logs文件夹下不断生成的日志文件
在根目錄下的logs文件夾中,經常生成一些錯誤文件類似myDEBUGxxxxx.log這樣的錯誤文件(而且這樣的錯誤文件由來并非網站出現什麽嚴重不可挽救的錯誤,大部分是一些未定義變量這樣的不起眼的小錯 ...
- Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs f
今天调试安卓程序遇到的问题Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching fa ...
- (error) MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about t
运行redis过程中,突然报错如下: (error) MISCONF Redis is configured to save RDB snapshots, but is currently not a ...
- System.Security.SecurityException The source was not found, but some or all event logs could not be searched.Inaccessible logs Security.
An exception occurred during the Install phase. System.Security.SecurityException The source was not ...
- Android_bug之 task ':app:mergeDebugResources'. > Some file crunching failed, see logs f
今天调试安卓程序遇到的问题Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching fa ...
- how to monitor system logs and export to files simultaneously
What will you do when you conduct a malware analysis on a smartphone? You will focus on running proc ...
随机推荐
- Nginx 针对建立TCP连接优化
L:124 sysctl -a | grep file-max //通过命令查看系统最大句柄数 [root@3 ~]# sysctl -a | grep file-max fs.file-max = ...
- python 项目启动路径自动添加
import os import sys base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) #找到当前项目 ...
- Redis 5种数据结构
转载:https://baijiahao.baidu.com/s?id=1593806211408070879&wfr=spider&for=pc Redis数据类型 Redis支持五 ...
- 基准对象object中的基础类型----列表 (四)
object有如下子类: CLASSES object basestring str unicode buffer bytearray classmethod complex dict enumera ...
- Android路径之Javascript基础-笔记
一.Javascript概述(知道) a.一种基于对象和事件驱动的脚本语言 b.作用: 给页面添加动态效果 c.历史: 原名叫做livescript.W3c组织开发的标准叫ECMAscipt. d.特 ...
- window文件过长无法删除的处理方式
解决方案: 如:aaa是要删除的文件夹,进入到要删除的文件夹下,新建一个test 1.以管理员身份打开CMD: 2 新建test空白目录: 3 执行命令,删除aaa文件夹:robocopy te ...
- IDEA 不识别的MAVEN 项目应如何处理
有些人啊,上传到git的项目,根本不是项目而是一个文件夹,文件夹里边还有个文件夹那才是项目,IDEA 不会识别出它是项目来 这个时候,需要选择这个文件夹下的pom.xml 文件 右键 pom.xml然 ...
- MySQL 报错 1055
具体报错 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'exer.student.sid' w ...
- LVS-Keepalived高可用集群(NAT)
LEA-6-LVS-NAT+Keepalived高可用集群-------client-----------------主LVS-----------------从LVS---------------- ...
- Python中字符串、列表、元组、字典、集合常用方法总结