我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

RabbitMQ Go教程日志。Printf无法写入磁盘文件?

I'm following the RabbitMQ tutorial via go. Here is the link: https://www.rabbitmq.com/tutorials/tutorial-four-go.html

when I run the following command to log message to file:

go run receive_logs_direct.go warning error>logs_from_rabbit.log

But the logs_from_rabbit.log file still empty.

enter image description here

What's wrong with it?

It seems your redirect is missing logs from the standard error output.

Try:

go run receive_logs_direct.go warning error >stdout.log 2>stderr.log

Or:

go run receive_logs_direct.go warning error 2>&1 >full.log

近期文章

  • 为什么建议使用ctx作为第一个参数?
  • Go中具有动态类型(空接口)的XML Unmarshal
  • GORM中的一对多递归关系
  • 如何找到函数类型的实现?
  • 在GoTour并发教程中为何需要Goroutines的解释
  • Go Dep无法解析“ golang.org/x/crypto”
  • 如何解决此程序中打印出的JSON数据?
  • 我如何将动态Viper或JSON键解组为Go中的struct字段的一部分
  • 从Google存储设备加载文件时在bigquery中使用.Run(ctx)复制记录
  • 无法在Gobuffalo中验证并创建模型
  • 包含其他目录中的模板
  • golang创建多级字符串映射
  • Go例程矩阵乘法错误
  • testlink远程访问缓慢
  • 求c++ 编译后的dll反编译工具
  • 哈希字符串的有界并行性[重复]
  • 如何分发仅二进制包
  • 无法分配给映射中的结构字段
  • 是否可以通过Golang中的枚举类型反映出枚举变量
  • Golang界面和实型

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华