syslog

how to get php errors to show on syslog

风流意气都作罢 提交于 2019-12-05 02:03:34
I have a script which is scheduled to run on crontab. I noticed that I could not see php errors anywhere. I wanted to be able to see php errors logged on /var/log/syslog or some place else. I have tried configuring my php.ini to log the errors on /var/log/php-errors.log, checked permissions and restarted the apache service still no logs. There are two issues to consider: First, PHP CLI uses a different php.ini than the version of PHP that runs via Apache. Make sure you are editing the error_log in the CLI version. Second, make sure your log file is writable by the user that runs cron. Usually

Using syslog in rails application

守給你的承諾、 提交于 2019-12-05 01:42:59
I am thinking of using syslog in my rails applications. The process is outlined in this blog post : Add gem 'SyslogLogger' to your Gemfile Add require 'syslog_logger' to the top of config/environments/production.rb Also uncomment the config.logger = line in the same file. In production box I have 4 rails applications running using passenger. If I switch to use syslogger for all 4 of my applications then I am afraid that the log messages from all 4 applications will go to a single file and the log messages will be interleaving. Of course, I can use splunk but first I wanted to check if it was

Python's SyslogHandler and TCP

吃可爱长大的小学妹 提交于 2019-12-04 11:50:30
I'm trying to understand why the SyslogHandler class from Python's logging framework (logging.handlers) does not implement any of the framing mechanism described by RFC 6587: Octet Counting : it "prepends" the message length to the syslog frame: Non-Transparent-Framing : a trailer character to separate messages. This is what most of the servers understand. This "problem" can be easily solved by adding a LF character to the end of the messages, however I would expect that the SyslogHandler would take care of this by default: sHandler = logging.handlers.SysLogHandler(address=(address[0], address

how to parse syslog timestamp

百般思念 提交于 2019-12-04 11:34:34
http://www.syslog.cc/ietf/drafts/draft-ietf-syslog-protocol-23.txt 6.2.3.1. Examples in the above link provides examples of different timestamp formates. How can I parse these timestamps in C ? On-the-fly, any type of message can arrive and I want to be able to parse it. asc99c The date format is a stricter version of RFC3339 giving a string such as '2011-08-18T23:31:42Z' I'm not certain the strptime function can deal with the timezone specifier (Z in the time string above), so it may be easier to handle that inside your own function. It definitely can't handle fractional seconds, since struct

ELK 架构之 Logstash 和 Filebeat 安装配置

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 08:44:58
阅读目录: 1. 环境准备 2. 安装 Logstash 3. 配置 Logstash 4. Logstash 采集的日志数据,在 Kibana 中显示 5. 安装配置 Filebeat 6. Filebeat 采集的日志数据,在 Kibana 中显示 7. Filebeat 采集日志数据,Logstash 过滤 8. Filebeat 采集的日志数据,Logstash 过滤后,在 Kibana 中显示 上一篇主要说的是 Elasticsearch 和 Kibana 安装配置,以及服务追踪数据的处理和展示,日志数据采集使用的 Spring Cloud Sleuth Zipkin + Stream/RabbitMQ 中间件(Service 端配置),然后 Zipkin Server 从队列中获取日志数据,再使用 HTTP 的请求的方式,传输并存储到 Elasticsearch 中,最后 Kibana 进行日志数据展示。 在 ELK Stack 中,日志数据采集有单独的工具,就是 Logstash 和 Beats。 Logstash 主要是用来日志的搜集、分析、过滤日志的工具,支持大量的数据获取方式。一般工作方式为 c/s 架构,client 端安装在需要收集日志的主机上,server 端负责将收到的各节点日志进行过滤、修改等操作在一并发往 Elasticsearch 上去。

PHP错误日志

女生的网名这么多〃 提交于 2019-12-04 07:08:24
我们可以在单独的文本文件中将错误报告作为日志记录。错误日志的记录,可以帮助开发人员或者 管理人员查看系统是否存在问题。 如果需要将程序中的错误报告写入错误日志中,只要在PHP的配置文件中,将配置指令log_errors开启即可。错误 报告默认就会记录到Web服务器的日志文件里,例如记录到Apache服务器的错误日志文件error.log中。当然也可以记录错误日志到指定的文件中 或发送给系统syslog,分别介绍如下: 1、使用指定的文件记录错误报告日志 使 用指定的文件记录错误报告日志使用指定的文件记录错误报告日志使用指定的文件记录错误报告日志 如果使用自己指定的文件记录错误日志,一定要确保将这个文 件存放在文档根目录之外,以减少遭到攻击的可能。并且该文件一定要让PHP脚本的执行用户(Web服务器进程所有者)具有写权限。假设在Linux操作系 统中,将/usr/local/目录下的error.log文件作为错误日志文件,并设置Web服务器进程用户具有写的权限。然后在PHP的配置文件中, 将error_log指令的值设置为这个错误日志文件的绝对路径。 需要将php.ini中的配置指令做如下修改: 1. error_reporting = E_ALL ;将会向PHP报告发生的每个错误 2. display_errors = Off ;不显示满足上条 指令所定义规则的所有错误报告 3.

数据后台管理(五)AOP日志

末鹿安然 提交于 2019-12-04 03:46:00
为了增加数据的安全性,在数据管理的过程中,我们需要将操作者访问时间,操作者的名称,访问的IP,访问资源的URL,执行时长,访问方法记录下来存储到数据库中,并可以通过页面查看。 1.将日志信息存储到数据库中 1.1根据需要记录的日志内容在数据库中创建表syslog和对应的实体类SysLog 日志表syslog SysLog类 SysLog 1.2在controller包下新建一个切面类LogAop来获取需要记录日志内容 注意该类作为切面类需要注解@Aspect 在该切面类内创建一个前置通知@Before("execution(* club.nipengfei.ssm.controller.*.*(..))"),一个后置通知@After("execution(* club.nipengfei.ssm.controller.*.*(..))"),注解内的属性表示切入点表达式,在这里表示controller包下的所有类。 1.2.1获取操作者的访问时间 直接在前置通知内new一个Date() 1.2.2获取操作者名称 1 // 获取当前操作的用户 2 SecurityContext context = SecurityContextHolder.getContext(); 3 User user =(User) context.getAuthentication()

Raspberry Pi 2 Crash: Internal error oops preempt smp arm

蓝咒 提交于 2019-12-04 02:29:22
问题 After 24 Hours i get on the Raspberry Pi 2 Syslogs Messages and after this i must Hard Reset/Reboot the Pi. Message from syslogd@raspberry at Mar 20 23:30:53 ... kernel:[12540.865789] Internal error: Oops: 17 [#1] PREEMPT SMP ARM Message from syslogd@raspberry at Mar 20 23:30:53 ... kernel:[12542.177016] Process motion (pid: 3151, stack limit = 0xb90c8238) Message from syslogd@raspberry at Mar 20 23:30:53 ... kernel:[12542.183009] Stack: (0xb90c9d18 to 0xb90ca000) Message from syslogd

Increase precision of apache log to include milliseconds

半城伤御伤魂 提交于 2019-12-04 01:59:32
I have modified the configuration of rsyslogd to disable RSYSLOG_TraditionalFileFormat . But still the apache log /var/log/apache/error.log is displaying only second-precission. Is there something else that needs to be configured? grzchr15 At http://httpd.apache.org/docs/current/mod/mod_log_config.html you see differemt time formats including mili seconds Just change from %t to %{%d/%b/%Y:%T}t-%{msec_frac}t for miliseconds or %{%d/%b/%Y:%T}t-%{usec_frac}t for microsecs Example: 16/Mar/2013:22:44:34-634 16/Mar/2013:22:44:34-634200 Documenation apache %t Time the request was received, in the

思科交换机配置syslog记录日志到syslog watcher日志记录软件

蓝咒 提交于 2019-12-03 23:47:42
C3560#config t C3560(config)#logging on C3560(config)#logging host 192.168.210 //日志服务器的IP地址 C3560(config)#logging facility local0 //日志临时存储位置 C3560(config)#logging origin-id {hostname|ip|string} C3560(config)#logging trap 3 //日志记录级别 C3560(config)#logging source-interface bvi 1 //日志发出用的源IP地址 C3560(config)#service timestamps debug datetime localtime //日志记录的时间戳设置,可根据需要具体配置 C3560(config)#service timestamps log datetime localtime 来源: 51CTO 作者: zhang书虫 链接: https://blog.51cto.com/zhangguangjun/2063663