WebLogic在Debian上的日志管理方法
一 日志位置与常用查看
二 WebLogic内置日志轮转
三 操作系统层 logrotate 管理
/u01/app/weblogic/domain_name/logs/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 640 weblogic weblogic
copytruncate
}
四 集中监控与告警
input {
file {
path => "/u01/app/weblogic/domain_name/logs/*.log"
start_position => "beginning"
sincedb_path => "/var/lib/logstash/sincedb_weblogic"
}
}
filter {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:loglevel} %{JAVACLASS:class} - %{GREEDYDATA:message}" }
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "weblogic-%{+YYYY.MM.dd}"
}
}
五 日常维护与故障排查要点