zoukankan      html  css  js  c++  java
  • jboss~静态文件路由和自定义日志

    由于我的jboss项目去在容器中运行的,所以我习惯上把这些扩展功能添加到cli文件 ,然后在Dockerfile里把它们进行添加,动态为主程序添加功能。

    • Dockerfile
    FROM jboss/keycloak:14.0.0
    USER root
    # 日志
    ADD log4.cli /opt/jboss/startup-scripts/
    # 静态文件路由
    ADD static_resource.cli /opt/jboss/startup-scripts/
    
    • log4.cli
    embed-server --server-config=standalone-ha.xml --std-out=echo
    batch
    
    /subsystem=logging/logger=org.keycloak.events:add
    /subsystem=logging/logger=org.keycloak.events:write-attribute(name=level,value=DEBUG)
    /subsystem=logging/size-rotating-file-handler=EVENTLOG:add(file={path=events.log,relative-to=jboss.server.log.dir})
    /subsystem=logging/size-rotating-file-handler=EVENTLOG:write-attribute(name=level,value=DEBUG)
    /subsystem=logging/size-rotating-file-handler=EVENTLOG:write-attribute(name=rotate-size, value=10M)
    /subsystem=logging/size-rotating-file-handler=EVENTLOG:write-attribute(name=max-backup-index, value=5)
    /subsystem=logging/size-rotating-file-handler=EVENTLOG:write-attribute(name=append,value=true)
    /subsystem=logging/size-rotating-file-handler=EVENTLOG:write-attribute(name=formatter,value="%d{yyyy-MM-dd HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%e%n")
    /subsystem=logging/size-rotating-file-handler=EVENTLOG:write-attribute(name=autoflush,value=true)
    /subsystem=logging/root-logger=ROOT:add-handler(name=EVENTLOG)
    
    /subsystem=logging/size-rotating-file-handler=ACCESSLOG:add(file={path=access_log.log,relative-to=jboss.server.log.dir})
    /subsystem=logging/size-rotating-file-handler=ACCESSLOG:write-attribute(name=level,value=INFO)
    /subsystem=logging/size-rotating-file-handler=ACCESSLOG:write-attribute(name=rotate-size, value=10M)
    /subsystem=logging/size-rotating-file-handler=ACCESSLOG:write-attribute(name=max-backup-index, value=5)
    /subsystem=logging/size-rotating-file-handler=ACCESSLOG:write-attribute(name=append,value=true)
    /subsystem=logging/size-rotating-file-handler=ACCESSLOG:write-attribute(name=formatter,value="%d{yyyy-MM-dd HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%e%n")
    /subsystem=logging/size-rotating-file-handler=ACCESSLOG:write-attribute(name=autoflush,value=true)
    /subsystem=logging/root-logger=ROOT:add-handler(name=ACCESSLOG)
    
    /subsystem=logging/size-rotating-file-handler=SERVERLOG:add(file={path=server.log,relative-to=jboss.server.log.dir})
    /subsystem=logging/size-rotating-file-handler=SERVERLOG:write-attribute(name=level,value=INFO)
    /subsystem=logging/size-rotating-file-handler=SERVERLOG:write-attribute(name=rotate-size, value=10M)
    /subsystem=logging/size-rotating-file-handler=SERVERLOG:write-attribute(name=max-backup-index, value=5)
    /subsystem=logging/size-rotating-file-handler=SERVERLOG:write-attribute(name=append,value=true)
    /subsystem=logging/size-rotating-file-handler=SERVERLOG:write-attribute(name=formatter,value="%d{yyyy-MM-dd HH\:mm\:ss,SSS} %-5p [%c] (%t) %s%e%n")
    /subsystem=logging/size-rotating-file-handler=SERVERLOG:write-attribute(name=autoflush,value=true)
    /subsystem=logging/root-logger=ROOT:add-handler(name=SERVERLOG)
    
    run-batch
    stop-embedded-server
    
    • static_resource.cli
    embed-server --server-config=standalone-ha.xml --std-out=echo
    batch
    /subsystem=undertow/configuration=handler/file=static_resource:add(path="/opt/jboss/keycloak/standalone/welcome-content")
    /subsystem=undertow/server=default-server/host=default-host/location=\/:write-attribute(name=handler,value=static_resource)
    run-batch
    stop-embedded-server
    

  • 相关阅读:
    OC和Swift中的UITabBar和UINaviGationBar的适配 [UITabbar在IPad中的适配]
    <iOS开发>之App上架流程(2017)
    iOS--LaunchImage启动页设置及问题解决
    去掉ambiguous expansion of macro警告
    iosapp开发者账号信息管理
    开发一个 app 有多难?
    Android SDK下载安装及配置教程
    抽象类和借口的区别
    array,vertor,arraylist,hashable,hashmap等几个易混淆概念的区别
    判断Set里的元素是否重复、==、equals、hashCode方法研究-代码演示
  • 原文地址:https://www.cnblogs.com/lori/p/15726404.html
Copyright © 2011-2022 走看看