Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

request log rotate may not work properly. #3971

JerryLee ·

Hello,
I would like to ask you how do I change my jetty.xml file to set daily log rotation.
Here is my jetty.xml in './conf' folder.
The log rorate work only first 2nd day from restart the service.
i.e. only two request log file exist in log folder. (1st day, 2nd day ~ now)

Please share your setting property, if you know how to set.

`

<Get name="ThreadPool">
            <Set name="minThreads">64</Set>
            <Set name="maxThreads">1024</Set>
    </Get>

<Ref id="Handlers">
	<Call name="addHandler">
		<Arg>
			<New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
				<Set name="requestLog">
					<New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
						<Set name="filename">../logs/yyyy_mm_dd.request.log</Set>
						<Set name="filenameDateFormat">yyyy_MM_dd</Set>
						<Set name="retainDays">2</Set>
						<Set name="append">true</Set>
					</New>
				</Set>
			</New>
		</Arg>
	</Call>
</Ref>

<!--Ref id="SocketConnector">
	<Set name="acceptQueueSize">256</Set>
</Ref-->
`
  • replies 5
  • views 1462
  • stars 0
robinshen ADMIN ·

How you tried to increase the retainDays property?

JerryLee ·

@robinshen
Thanks to reply.
As far as I know, 'retainDays' to be kept how many days before being deleted.
Therefore, it shouldn't be affected, I think.
Plus, I set the day as '30' as you recommended (you asked me increase the value), but the result was same.
Currently, we have various QB master servers and, below jetty.xml works well(rotate well) in QB6.

<Ref id="Handlers">
    <Call name="addHandler">
        <Arg>
            <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
                <Set name="requestLog">
                    <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
                        <Set name="filename">../logs/yyyy_mm_dd.request.log</Set>
                        <Set name="filenameDateFormat">yyyy_MM_dd</Set>
                        <Set name="retainDays">30</Set>
                        <Set name="append">true</Set>
                        <Set name="LogLatency">true</Set>
                    </New>
                </Set>
            </New>
        </Arg>
    </Call>
</Ref>

QuickBuild 6.0.21
QuickBuild 6.1.15
-rw-r--r-- 1 root root 77428553 Jul 24 23:59 2018_07_24.request.log
-rw-r--r-- 1 root root 77384725 Jul 25 23:59 2018_07_25.request.log
-rw-r--r-- 1 root root 77215938 Jul 26 23:59 2018_07_26.request.log
-rw-r--r-- 1 root root 76833739 Jul 27 23:59 2018_07_27.request.log
-rw-r--r-- 1 root root 76548543 Jul 28 23:59 2018_07_28.request.log
-rw-r--r-- 1 root root 76549144 Jul 29 23:59 2018_07_29.request.log
-rw-r--r-- 1 root root 59978995 Jul 30 18:37 2018_07_30.request.log

In conclusion, we set the same jetty.xml file in QB7, QB8 but it doesn't work what we expected.
Plus, I fount that latest QB8 source code has the same jetty version like QB7.
QuickBuild 7.0.31
-rw-r--r-- 1 root root 5650016989 Jul 30 18:37 2018_05_28.request.log
QuickBuild 8.0.14
-rw-r--r-- 1 root root 47281 Jul 31 10:14 2018_07_30.request.log

Please check it and let me know if you need any other information to be checked.
Since I have no idea whether this issue depends on QB or jetty, I didn't create the item in 'http://track.pmease.com'.

robinshen ADMIN ·

Thanks for the detailed information. It is actually a bug of Jetty version used in QB7 and QB8. It has been fixed in Jetty 9.4.8 and higher, but we can not upgrade now as it requires Java 1.8. QB9 (to be released at the end of this year) will set Java 1.8 as minimum requirement and we will upgrade Jetty to get it fixed.

JerryLee ·
robinshen ADMIN ·

Some other user experienced the issue told me that the issue is fixed in 9.4.8 onward. Maybe he just tested 9.4.8... It is great that 9.2.22 contains the fix as 9.2.x can still run on Java 1.7. The fix is now in QB 7.0.32 and 8.0.15. Please give it a try.