Giter VIP home page Giter VIP logo

log4server's Introduction

log4server

log4server是个简单的日志收集服务,是使用log4j的SocketServer,用来收集分布式系统中的日志,方便集中日志查询、分析

1.日志服务启动脚本bin/restart_server.sh
主要配置是conf/generic.lcf
第一行是指定日志存储路径
第二段是配置全局日志存储,所有接收到的日志都会在这边输出
第三、四段是配置局部日志存储,可以细分指定一个包输出到一个日志文件,用来区分项目挺方便 log4j.logger.org.langke.core=INFO,rest-nettyserver
这里的包名跟项目包名对上就可以了

2.客户端配置参考:doc/log4j.properties
主要就是把下列配置加到各个服务器的log4j.properties
rootLogger加下SOCKET_CLIENT

log4j.rootLogger=INFO,SOCKET_CLIENT

#remote logging
log4j.appender.SOCKET_CLIENT = org.apache.log4j.net.SocketAppender
log4j.appender.SOCKET_CLIENT.RemoteHost = log4server
log4j.appender.SOCKET_CLIENT.Port = 5001
log4j.appender.SOCKET_CLIENT.LocationInfo = true

这里log4server是指向log4server服务器host,需要配置hosts文件,或者直接用ip

log4server's People

Contributors

langke93 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.