Redirect Tomcat 7 console log output to a file (Windows)

前端 未结 2 657
独厮守ぢ
独厮守ぢ 2020-12-23 22:20

How do I redirect Tomcat 7 console log output to a file on Windows?

2条回答
  •  既然无缘
    2020-12-23 22:32

    To get the Tomcat output and share it:: 1. Make a file " Start_Tomcat.bat " put the below lines in that.

    cd C:\XXX\apache-tomcat-6.0.20\bin
            catalina.bat run > C:\XXX\apache-tomcat-6.0.20\logs\tomcat1.log 2>&1
    

    NOTES:: C:\XXX\apache-tomcat-6.0.20\bin -- is the systems bin address " \logs\tomcat1.log 2>&1 " should not change...

        Ques:: What does the 2>&1 do?
        Ans:: 2>&1 means output only to file. Without that it would output to both text and console.
    
    1. Paste the file in the below location::: " C:\XXX\apache-tomcat-6.0.20\bin "

    2. Run " Startup.bat " & " Start_Tomcat.bat "

    3. You will get " C:\XXX\apache-tomcat-6.0.20\logs\tomcat1.log " . Share the "tomcat1.log" file so others can see your tomcat responses.

提交回复
热议问题