Log collection for Dcos-docker

Source: Internet
Author: User
Tags syslog loggly

java log Configuration

<?xml version= "1.0" encoding= "UTF-8"?> <!--Copyright 2010-2011 the MyBatis Team Licensed under the Apach
    E License, Version 2.0 (the "License");
    You are not a use of this file except in compliance with the License. Obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 unless required by applicab  Le law or agreed to writing, software distributed under the License are distributed on a "as is" BASIS, without
    Warranties or CONDITIONS of any KIND, either express OR implied.
See the License for the specific language governing permissions and limitations under the License. --<configuration debug= "false" > <!--define the storage address of the log file do not use relative paths in Logback configuration--<property name= "Log_h OME "value="/data/logs/1232 "/> <!--console output--<appender name=" STDOUT "class=" Ch.qos.logback.core.Conso Leappender "> <Encoding>UTF-8</Encoding> <layout class=" Ch.qos.logback.Classic. Patternlayout "> <!--formatted output:%d for date,%thread for thread name,%-5level: Level shows 5 character width from left%msg: Log message,%n is line break--&L T;pattern>[%-5level]%d{yyyy-mm-dd HH:mm:ss. SSS} [%thread]%logger{500}-%msg%n</pattern> </layout> </appender> <!--generate error log per day Pieces--<appender name= "Error_file" class= "Ch.qos.logback.core.rolling.RollingFileAppender" > <encod ing>utf-8</encoding> <file>${LOG_HOME}/123.error.log</file> <rollingpolicy class= "Ch.qos. Logback.core.rolling.FixedWindowRollingPolicy "> <filenamepattern>${log_home}/123.%i.error.log</ filenamepattern> <minIndex>1</minIndex> <maxIndex>10000</maxIndex> </roll ingpolicy> <triggeringpolicy class= "Ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy" > <maxfi
          Lesize>1mb</maxfilesize> </triggeringPolicy> <encoder>  <pattern>[%-5level]%d{yyyy-mm-dd HH:mm:ss. SSS} [%thread]%logger{500}-%msg%n</pattern> </encoder> </appender> <appender Name
        = "Info_file" class= "Ch.qos.logback.core.rolling.RollingFileAppender" > <Encoding>UTF-8</Encoding> <file>${LOG_HOME}/123.info.log</file> <rollingpolicy class= "Ch.qos.logback.core.rolling.FixedWind Owrollingpolicy "> <fileNamePattern>${LOG_HOME}/123.%i.info.log</fileNamePattern> &LT;MININDEX&G t;1</minindex> <maxIndex>10000</maxIndex> </rollingPolicy> <triggeringpolicy clas s= "Ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy" > <maxFileSize>1MB</maxFileSize> </tr Iggeringpolicy> <encoder> <pattern>[%-5level]%d{yyyy-mm-dd HH:mm:ss. SSS} [%thread]%logger{500}-%msg%n</pattern> </encoder> </appender> <configuration debug= "true" > <appender name= "loggly" class= "Ch.qos.logback.classic.net.SyslogAppender" > <sy Sloghost>localhost</sysloghost> <facility>SYSLOG</facility> <port>514</port&
        Gt <suffixpattern>java%D{ISO8601,UTC}%p%t%c{0}.%m-%m%n</suffixpattern> </appender> <root le Vel= "Info" > <appender-ref ref= "loggly"/> </root> </configuration> <!--log level for this project --<logger name= "Net.123.server" level= "INFO"/> <logger name= "org.springframework.amqp" level= "WARN"/ > <!--show parameters for Hibernate SQL is specifically designed for hibernate--<logger name= "Org.hibernate.ptype.descrip Tor.sql.BasicBinder "level=" INFO "/> <logger name=" Org.hibernate.ptype.descriptor.sql.BasicExtractor "level=" Info "/> <logger name=" Org.hibernate.SQL "level=" info "/> <logger name=" Org.hibernate.engine.QueryParame Ters "Level=" INFO "/> <logger name=" Org.hibernate.engine.query.HQLQueryPlan "level=" INFO "/> <!--myibatis log configure- -<logger name= "java.sql.Connection" level= "info"/> <logger name= "java.sql.Statement" level= "INFO"/&G
    T <logger name= "java.sql.PreparedStatement" level= "info"/> <logger name= "org.apache.commons" level= "info"/&
    Gt <!--log output level-<root level= "INFO" > <appender-ref ref= "STDOUT"/> <appender-ref re
 f= "Info_file"/> <appender-ref ref= "Error_file"/> </root> </configuration>
Syslog-ng process inside Docker
[Root@d390c7582ad7 syslog-ng]# Cat syslog-ng.conf @version: 3.2 # syslog-ng configuration file. # # should behave pretty much like the original syslog on RedHat.
But # it could is configured a lot smarter.
# # See Syslog-ng (8) and syslog-ng.conf (5) For more information.
    # options {flush_lines (0);
    Time_reopen (10);
    Log_fifo_size (1000);
    Long_hostnames (off);
    Use_dns (no);
    Use_fqdn (no);
    Create_dirs (no);
Keep_hostname (yes);

};
          Options {long_hostnames (off); Flush_lines (0); Use_dns (no); Use_fqdn (no); Owner ("root"); Group ("ADM"); Perm (0640);
          Stats_freq (0);
Bad_hostname ("^gconfd$");

}; SOURCE test{file ("/data/logs/123-123/xcloud-cs.2016-11-24_0.error.log" follow_freq (1) program_override ("123-123.
    Error "));
File ("/data/logs/123-123/123-123.2016-11-24_0.info.log" follow_freq (1) program_override ("123-123.info"));
};
Destination Test {syslog ("192.168.126.15" Transport ("TCP") port (5555) template ("$MESSAGE \ n"));}; 
        Log {source (test); 
Destination (test);
 };
syslog-ng Server Process configuration
[root@t15 conf.d]# cat a.conf 
@version: 3.5

source log5555 {
    syslog (IP (0.0.0.0) port (5555));
};

Destination log5555 { 
    file ("/var/log/syslog-ng/$PROGRAM/${s_month}${s_day}/${host}.${sourceip}.log"); 
};
log{
    Source (log5555);d estination (log5555);
};

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.