You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/12/15 20:23:29 UTC
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6390: Updated log4j from version 1.2.17 to version 2.16.0
zrhoffman commented on a change in pull request #6390:
URL: https://github.com/apache/trafficcontrol/pull/6390#discussion_r770013166
##########
File path: traffic_router/core/src/main/conf/log4j2.xml
##########
@@ -0,0 +1,49 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "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>
+ <Appenders>
+ <Console name="stdout" target="SYSTEM_OUT">
+ <PatternLayout pattern="%m%n" />
+ </Console>
+ <RollingFile name="traffic_router_access"
+ fileName="${deploy.dir}/var/log/access.log"
+ filePattern="${deploy.dir}/var/log/access-%d{yyyy-MM-dd}.log" >
+ <PatternLayout pattern="%m%n" />
+ <Policies>
+ <SizeBasedTriggeringPolicy size="200MB" />
+ </Policies>
+ <DefaultRolloverStrategy max="10" />
+ </RollingFile>
+ <RollingFile name="traffic_router"
+ fileName="${deploy.dir}/var/log/traffic_router.log"
+ filePattern="${deploy.dir}/var/log/traffic_router-%d{yyyy-MM-dd}.log" >
+ <Policies>
+ <SizeBasedTriggeringPolicy size="100MB" />
+ </Policies>
+ </RollingFile>
Review comment:
The `"traffic_router"` log should use the same pattern that the `A1` log did in log4j 1.2:
https://github.com/apache/trafficcontrol/blob/ea85a4b39461ddd11a2d09bf17dda9429a238889/traffic_router/core/src/main/conf/log4j.properties#L33
Examples:
Expected | Actual
------ | -----
`INFO 2021-12-15T19:57:59.027 [Thread-2] org.apache.traffic_control.traffic_router.protocol.LanguidPoller - Waiting for state from mbean path traffic-router:name=languidState` | `Waiting for state from mbean path traffic-router:name=languidState`
`INFO 2021-12-15T19:58:01.628 [main] org.apache.traffic_control.traffic_router.core.loc.AbstractServiceUpdater - [FederationsWatcher] Fetching external resource https://${toHostname}/api/2.0/federations/all at interval: 300000 : MILLISECONDS next update occurrs at Wed Dec 15 20:03:01 UTC 2021` | `[FederationsWatcher] Fetching external resource https://${toHostname}/api/2.0/federations/all at interval: 300000 : MILLISECONDS next update occurrs at Wed Dec 15 19:40:04 UTC 2021`
`INFO 2021-12-15T19:58:01.631 [main] org.apache.traffic_control.traffic_router.core.loc.AbstractServiceUpdater - [SteeringWatcher] Fetching external resource https://${toHostname}/api/2.0/steering at interval: 10000 : MILLISECONDS next update occurrs at Wed Dec 15 19:58:11 UTC 2021` | `[SteeringWatcher] Fetching external resource https://${toHostname}/api/2.0/steering at interval: 10000 : MILLISECONDS next update occurrs at Wed Dec 15 19:35:14 UTC 2021`
`INFO 2021-12-15T19:58:01.674 [main] org.apache.traffic_control.traffic_router.core.secure.CertificatesPoller - No custom value for certificates.polling.interval` | `No custom value for certificates.polling.interval`
`ERROR 2021-12-15T19:58:01.677 [pool-2-thread-1] org.apache.traffic_control.traffic_router.core.secure.CertificatesClient - No traffic ops hostname yet!` | `No traffic ops hostname yet!`
and so on
##########
File path: infrastructure/ansible/roles/traffic-router/templates/conf/log4j.xml.j2
##########
@@ -13,6 +13,4 @@
#}
Review comment:
This should be renamed to `log4j2.xml.j2`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org