Re: 回复: 回复: tomcat 5 logs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 改变自己, On 3/20/14, 10:24 AM, 改变自己 wrote: thank you very much for your detailed explanation , now i just resolved it with another way, i used a cronlog.exe which is a executable file and can be used for produce daily files; Does it actually work? You are just using it in a piped-way like this, right? java (options) | cronolog.exe (options) For some reason, I've never trusted long-running pipes on Windows... and other configration is the same as my primary way. Glad you solved your issue. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTLIW2AAoJEBzwKT+lPKRYFrEQAMh8qgx8zR7tNvH84qI924WL ya7v1Sw3hoT5H805YIUznyR4ystq9M66dXfJrykftaeffqcl183qrBbCfO6GziqO HoQyt/l3G2wEBU5Dd5Qary17n5/di7hl0WmjQuyHu3Tyh4sxEYHAh3OOe9T5OYxO Cg1JiMoYQV25jwOYkGT8kQyTXirpP4gXJ7IiVK8x7CSNfH1QraA/8PdRWPo5w42s yJpEjNsWt+SQhWgDa/g6ACn7QcPk0vyPfxxO1v9XrFA5JHnRvWJMziRKAJ4WA3Fq YDHPzBrqjp0d11nhW1hn5KnYjFoUfdro8ez4lMqv+3vntbijQMd5Nx8oEHEKMAmA cN+ZouuEElDIduUiBRRXmFShm/9UdZGH/GI2t0E+xJMKtJkJrG5UrbgNvusVVo3A GT9i4ImsvwwG6P1QLKaRu2Zceyv6LpLvID1hVuMnNsS+eWX2cO1vGrWhG+7pJlq3 xg6zm+72LHH3b+CS/u4eS+J6HeZ6qBxtHdszH45h804bm6QS0l8xEOroFEfTfYaD aSb4Ngu3g9KvWNYPwe1B0ANPXn/dLz97vIzW84KXK96zvuyJCSgoguQvJGcTpIxS hLmhBtaJSaszuGj3E47nn5ZmnhQQDU3fLy3W7HnL4Ka0hYde97tldXGlPHNTL88S maUWwlWYH8LZ+B3625Wn =zujf -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 回复: tomcat 5 logs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 改变自己, On 3/20/14, 12:30 AM, 改变自己 wrote: the source of my problem is that in the application ,we just used many system.out sentence as a log output instead of using log4j, because it is really a old applicaiton ; now we need to capture the the system.out information as a log; You should take a look at the swallowOutput setting for your Context element. You can find documentation about it here: https://tomcat.apache.org/tomcat-5.5-doc/config/context.html Setting swallowOutput=true will cause System.out and System.err within the application to be routed to the context-logger, which you should be able to redirect to a rotatable log file. To configure the context logger, edit Tomcat's conf/logging.properties file. There should already be some configuration like this: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler These lines configure loggers for specific applications: the first pair of lines set up the logger for the manager application while the second pair configure those for the host-manager application. To set up one for your own application, do the following: Create a new handler (what actually writes to a file): 10my-context-path.org.apache.juli.FileHandler.level = FINE 10my-context-path.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 10my-context-path.org.apache.juli.FileHandler.prefix = my-context-path. Configure the context to write to the handler: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/my-context-path].handler=10my-context-path-handler.org.apache.juli.FileHandler Set the logging level: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/my-context-path].level=INFO (or ERROR, WARN, FINE, FINEST, ALL) The above, along with swallowOutput=true will take System.out.println(Some log message) from your web application deployed to /my-context-path and put it into CATALINA_BASE/logs/my-context-path.[-MM-dd].log. The file should be automatically rotated daily. In case it's not obvious, the my-context-path text above should be replaced with whatever your webapp's context path actually is. You can call the log filename anything you want, and you can name the logger (almost) anything you want -- check the documentation[1] -- but the line with the [Catalina].[localhost].[/my-context-path] must match your Service/Host/Context names (note the leading '/' in the context path in the final portion of the logger name). Finally, you should really upgrade. Tomcat 5 has been retired quite some time ago, and Tomcat 6 will be considered for the chopping block once Tomcat 8 is released. Fortunately, all of the above logging configuration is available in Tomcat 5.5, 6.0, 7.0, and 8.0 so it should still work for you if you upgrade. Good luck, - -chris [1] https://tomcat.apache.org/tomcat-5.5-doc/logging.html#java.util.logging -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTKvb9AAoJEBzwKT+lPKRYTKwQALKn+WqCHpEZpR6u4xt78cL3 wGceVd5nofSO0AK5A+FWFp80BhMWtucObmk11F4ZkasaLokFxQxmscA6UZt6pT7+ GCgM65R9uNvUqf15c/rL6KytKpI2mXvQRc4I+/HCIwZnELIu0+2j1BVoZsrB0Ms6 rBetukD/pHdWub5lPQGmOlgwt0tlb6Yam93+h9KpAd1CZLmpAHIY6pVZeDcX1ZNC j3MqMUspQxo0+SIH+RQ0MFwbWwsZ0aPM4rulGGXDJtlVQZNpcDeL94YbucC5Remt yDnmWQOuAZ/tyXsbbAfZWLRMtAEftMEsdFnYXDqXSKv71Un6NpoLOUvsSMqHYuyh +IgiOqkpNiZUjQdJPztXZNFxOZWtlGJd3A60NGWU+5X2ZnDRfJ4dbCTBHsEFG4Fy I/YIYhQQFuEj3ANsfpTjBSRhPtpeVlR65CUcReSEaM9hkDs4DKS2HLt15gzUSUIa vRFoALkihS7esqrjhd+/Rexy/loz8kGX2tqGchj8DgENO2XL6FG/9QCu6p/Wv6kc XXVsRKBkImE45YrVqjFnQNmjDhvckXr6nL/9lKE0gOkWWPneiDu3KXK0Vb3qFtf0 ASW7nC/umCOgdm5ERyGQhYm4Jry5Lco76BaUfSvtz9lFpMaiyk3yjunNVvcG/qVe YiQQU321q/pgARYMHoMH =5dC/ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
?????? ?????? tomcat 5 logs
thank you very much for your detailed explanation , now i just resolved it with another way, i used a cronlog.exe which is a executable file and can be used for produce daily files; and other configration is the same as my primary way. thank you all the same! best regards -- -- ??: Christopher Schultz;ch...@christopherschultz.net; : 2014??3??20??(??) 10:11 ??: Tomcat Users Listusers@tomcat.apache.org; : Re: ?? tomcat 5 logs -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 , On 3/20/14, 12:30 AM, wrote: the source of my problem is that in the application ,we just used many system.out sentence as a log output instead of using log4j, because it is really a old applicaiton ; now we need to capture the the system.out information as a log; You should take a look at the swallowOutput setting for your Context element. You can find documentation about it here: https://tomcat.apache.org/tomcat-5.5-doc/config/context.html Setting swallowOutput=true will cause System.out and System.err within the application to be routed to the context-logger, which you should be able to redirect to a rotatable log file. To configure the context logger, edit Tomcat's conf/logging.properties file. There should already be some configuration like this: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler These lines configure loggers for specific applications: the first pair of lines set up the logger for the manager application while the second pair configure those for the host-manager application. To set up one for your own application, do the following: Create a new handler (what actually writes to a file): 10my-context-path.org.apache.juli.FileHandler.level = FINE 10my-context-path.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 10my-context-path.org.apache.juli.FileHandler.prefix = my-context-path. Configure the context to write to the handler: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/my-context-path].handler=10my-context-path-handler.org.apache.juli.FileHandler Set the logging level: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/my-context-path].level=INFO (or ERROR, WARN, FINE, FINEST, ALL) The above, along with swallowOutput=true will take System.out.println(Some log message) from your web application deployed to /my-context-path and put it into CATALINA_BASE/logs/my-context-path.[-MM-dd].log. The file should be automatically rotated daily. In case it's not obvious, the my-context-path text above should be replaced with whatever your webapp's context path actually is. You can call the log filename anything you want, and you can name the logger (almost) anything you want -- check the documentation[1] -- but the line with the [Catalina].[localhost].[/my-context-path] must match your Service/Host/Context names (note the leading '/' in the context path in the final portion of the logger name). Finally, you should really upgrade. Tomcat 5 has been retired quite some time ago, and Tomcat 6 will be considered for the chopping block once Tomcat 8 is released. Fortunately, all of the above logging configuration is available in Tomcat 5.5, 6.0, 7.0, and 8.0 so it should still work for you if you upgrade. Good luck, - -chris [1] https://tomcat.apache.org/tomcat-5.5-doc/logging.html#java.util.logging -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTKvb9AAoJEBzwKT+lPKRYTKwQALKn+WqCHpEZpR6u4xt78cL3 wGceVd5nofSO0AK5A+FWFp80BhMWtucObmk11F4ZkasaLokFxQxmscA6UZt6pT7+ GCgM65R9uNvUqf15c/rL6KytKpI2mXvQRc4I+/HCIwZnELIu0+2j1BVoZsrB0Ms6 rBetukD/pHdWub5lPQGmOlgwt0tlb6Yam93+h9KpAd1CZLmpAHIY6pVZeDcX1ZNC j3MqMUspQxo0+SIH+RQ0MFwbWwsZ0aPM4rulGGXDJtlVQZNpcDeL94YbucC5Remt yDnmWQOuAZ/tyXsbbAfZWLRMtAEftMEsdFnYXDqXSKv71Un6NpoLOUvsSMqHYuyh +IgiOqkpNiZUjQdJPztXZNFxOZWtlGJd3A60NGWU+5X2ZnDRfJ4dbCTBHsEFG4Fy I/YIYhQQFuEj3ANsfpTjBSRhPtpeVlR65CUcReSEaM9hkDs4DKS2HLt15gzUSUIa vRFoALkihS7esqrjhd+/Rexy/loz8kGX2tqGchj8DgENO2XL6FG/9QCu6p/Wv6kc XXVsRKBkImE45YrVqjFnQNmjDhvckXr6nL/9lKE0gOkWWPneiDu3KXK0Vb3qFtf0 ASW7nC/umCOgdm5ERyGQhYm4Jry5Lco76BaUfSvtz9lFpMaiyk3yjunNVvcG/qVe YiQQU321q/pgARYMHoMH =5dC/ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org .
tomcat 5 logs
hello ,my friends now my boss let me get the tomcat console information(including the startup information and visit information ) and store it in a file; at the same time the file must be produced automaticlly every day; now i configed the startup.bat file which can get the the information i need ,but can not automatically produced a file every day; here is the configuration : I just changed the: call %EXECUTABLE% start %CMD_LINE_ARGS% to call %EXECUTABLE% run %CMD_LINE_ARGS% ..\logs\catalina.%date:~0,10%.out best regards
Re: tomcat 5 logs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 改变自己, On 3/19/14, 6:03 AM, 改变自己 wrote: now my boss let me get the tomcat console information(including the startup information and visit information ) and store it in a file; at the same time the file must be produced automaticlly every day; Do you mean that you want to get a different file every day for catalina.out? now i configed the startup.bat file which can get the the information i need ,but can not automatically produced a file every day; here is the configuration : I just changed the: call %EXECUTABLE% start %CMD_LINE_ARGS% to call %EXECUTABLE% run %CMD_LINE_ARGS% ..\logs\catalina.%date:~0,10%.out That will only work if you re-start Tomcat every day, because the filename is only evaluated when you launch Tomcat. If you want to restart Tomcat every day, then this will work. If you want to let it run for a long time (many days), you'll need to do something different. On Windows... I'm not sure what options are available for rotating the stdout file. On *NIX, if you use jsvc, you can move the existing file and then send a signal to the jsvc process which will close and re-open the old file. Perhaps that can be done on Windows, but you can no longer use startup.bat to launch Tomcat: you'll have to use a Windows Service instead. Let me ask about the source of the problem: are you getting lots and lots of things logging to stdout / catalina.out? If so, why? There shouldn't be a lot of stuff going to that log file. Instead, the logs should be going to an application-specific log file that can be rotated more easily. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTKaFmAAoJEBzwKT+lPKRYDlcQAIsbzdHgx79hky60+i/KVXs8 Q2m+AJS7sIe31GOxYvecZRjgW3LHA2LVe0kDRk4wVZIjBBqCKpdf6i4cjrEk+WxM qlSfrCEhpi9r1C0LEG56bnUFeLjKQ050FDKKOPZgx3aokKe6B/aUp4G+YPvqTZTw YjYEMjz8Xz+dfoOSD3qYXLNxlJJ+SG3kTqEwC2FLuKVHQI6vOLeHZtVeSII6cYhD veZeSLBqg68MrgGcbF50+s4t5LMVvPC0rwV2RbEPoJzBEaeVklEVrrmBH6BSfPIc DIFU7Vk1gnYONpGXdf+ZrKQ3NGav1AiEtWGxzoTg4bzGl6N5i/Rt618sOydQfzs+ pptWb1f+7xbrq6ZSzg/3JY4eCM45/PwwLVTc8uF363t4Pk+Mjos6kM6pkhuCZd5C gLApsqFAtzS1y++0b5jvsCXHVotCkZn9RVcIcNxva0afl0I4ZwM38ASADQIFNheh iF5v0fy6EaHmvHFAnK4VXhsYC43EPf96QAg2P76U9+64Pbxa6PVqOmR4KTqLvd7r Hb89Wzc8QfJmW5C5tGEkYrphnQA5iUVq6TnwaOJf+a8c2oplzaB6Grg+i4p6XDlY ktdVYyr3ggUMKpP7i4swaBXqSuyZyggyooV/eLwXRe0Wadab2gUoNCiG7Qi2fDJc 02ciR5Tw+pUqlG3wBBWZ =1tir -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
?????? tomcat 5 logs
the source of my problem is that in the application ,we just used many system.out sentence as a log output instead of using log4j, because it is really a old applicaiton ; now we need to capture the the system.out information as a log; your answer : On Windows... I'm not sure what options are available for rotating the stdout file. On *NIX, if you use jsvc, you can move the existing file and then send a signal to the jsvc process which will close and re-open the old file. Perhaps that can be done on Windows, but you can no longer use startup.bat to launch Tomcat: you'll have to use a Windows Service instead. I know very less about *nix system. so I really can not understand the approach ; would you please be more specific? thank you -- -- ??: Christopher Schultz;ch...@christopherschultz.net; : 2014??3??19??(??) 9:53 ??: Tomcat Users Listusers@tomcat.apache.org; : Re: tomcat 5 logs -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 , On 3/19/14, 6:03 AM, wrote: now my boss let me get the tomcat console information(including the startup information and visit information ) and store it in a file; at the same time the file must be produced automaticlly every day; Do you mean that you want to get a different file every day for catalina.out? now i configed the startup.bat file which can get the the information i need ,but can not automatically produced a file every day; here is the configuration : I just changed the: call %EXECUTABLE% start %CMD_LINE_ARGS% to call %EXECUTABLE% run %CMD_LINE_ARGS% ..\logs\catalina.%date:~0,10%.out That will only work if you re-start Tomcat every day, because the filename is only evaluated when you launch Tomcat. If you want to restart Tomcat every day, then this will work. If you want to let it run for a long time (many days), you'll need to do something different. On Windows... I'm not sure what options are available for rotating the stdout file. On *NIX, if you use jsvc, you can move the existing file and then send a signal to the jsvc process which will close and re-open the old file. Perhaps that can be done on Windows, but you can no longer use startup.bat to launch Tomcat: you'll have to use a Windows Service instead. Let me ask about the source of the problem: are you getting lots and lots of things logging to stdout / catalina.out? If so, why? There shouldn't be a lot of stuff going to that log file. Instead, the logs should be going to an application-specific log file that can be rotated more easily. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJTKaFmAAoJEBzwKT+lPKRYDlcQAIsbzdHgx79hky60+i/KVXs8 Q2m+AJS7sIe31GOxYvecZRjgW3LHA2LVe0kDRk4wVZIjBBqCKpdf6i4cjrEk+WxM qlSfrCEhpi9r1C0LEG56bnUFeLjKQ050FDKKOPZgx3aokKe6B/aUp4G+YPvqTZTw YjYEMjz8Xz+dfoOSD3qYXLNxlJJ+SG3kTqEwC2FLuKVHQI6vOLeHZtVeSII6cYhD veZeSLBqg68MrgGcbF50+s4t5LMVvPC0rwV2RbEPoJzBEaeVklEVrrmBH6BSfPIc DIFU7Vk1gnYONpGXdf+ZrKQ3NGav1AiEtWGxzoTg4bzGl6N5i/Rt618sOydQfzs+ pptWb1f+7xbrq6ZSzg/3JY4eCM45/PwwLVTc8uF363t4Pk+Mjos6kM6pkhuCZd5C gLApsqFAtzS1y++0b5jvsCXHVotCkZn9RVcIcNxva0afl0I4ZwM38ASADQIFNheh iF5v0fy6EaHmvHFAnK4VXhsYC43EPf96QAg2P76U9+64Pbxa6PVqOmR4KTqLvd7r Hb89Wzc8QfJmW5C5tGEkYrphnQA5iUVq6TnwaOJf+a8c2oplzaB6Grg+i4p6XDlY ktdVYyr3ggUMKpP7i4swaBXqSuyZyggyooV/eLwXRe0Wadab2gUoNCiG7Qi2fDJc 02ciR5Tw+pUqlG3wBBWZ =1tir -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org .