guyeuro
V2EX  ›  问与答

log4j 的日志显示[http-apr-8080-exec-5],这说明 tomcat 是以 apr 模式运行吗?

  •  
  •   guyeuro · Aug 21, 2017 · 6766 views
    This topic created in 3197 days ago, the information mentioned may be changed or developed.

    可是好像 tomcat 并没配置 apr 模式 log4j 的日志显示[http-apr-8080-exec-5]表示什么意思?

    7 replies    2017-08-22 19:57:10 +08:00
    azygote
        1
    azygote  
       Aug 21, 2017
    tomcat 内部有一个处理请求的线程池,[http-apr-8080-exec-5]是 tomcat 处理当前请求的线程名字。
    ixiaohei
        2
    ixiaohei  
       Aug 21, 2017
    是 apr 运行的。这个是 apr 的线程池。一般 jio 和 nio 都是带这些字样的。另外为什么不用 nio。
    guyeuro
        3
    guyeuro  
    OP
       Aug 22, 2017
    @ixiaohei
    intellij 下 tomcat 自动 apr 运行?
    另外我看远程的 tomcat 的 context.xml 好像没有配置 apr 啊
    guyeuro
        4
    guyeuro  
    OP
       Aug 22, 2017
    @azygote 那这个线程为何有 apr 字样?
    ixiaohei
        5
    ixiaohei  
       Aug 22, 2017
    @guyeuro tomcat 是检测到 apr 就会用 apr 模式运行。你是 win 下? linux 下一般要装 apr 相关包才会用 apr 运行。
    guyeuro
        6
    guyeuro  
    OP
       Aug 22, 2017
    @ixiaohei 我开发在 win 下,所以 win 的开发 tomcat 下自动是 apr 模式?

    另外 linux apr 模式不是需要 context.xml 配置吗?
    ixiaohei
        7
    ixiaohei  
       Aug 22, 2017
    @guyeuro Linux 要安装额外的包,具体百度。win 下是因为 tomcat 带了那个 dll 文件。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   969 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 23:01 · PVG 07:01 · LAX 16:01 · JFK 19:01
    ♥ Do have faith in what you're doing.