# Performance-Analyzer-Logs not rotated

**URL:** <https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434>\
**Category:** Performance Analyzer\
**Created:** [August 3, 2020, 10:49am UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434 "2020-08-03T10:49:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![micha](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@micha](https://forum.opensearch.org/u/micha)\
**Post date:** [August 3, 2020, 10:49am UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434/1 "2020-08-03T10:49:35Z")

</div>

Hi,

We are running out of space on /tmp on the elastic servers

```
-rw-r--r-- 1 elasticsearch elasticsearch 2305568768 Aug 3 12:36 performance_analyzer_agent_stats.log
-rw-r--r-- 1 elasticsearch elasticsearch 15613952 Aug 3 12:37 PerformanceAnalyzer.log

```

Especially the performance\_analyzer\_agent\_stats.log uses currently 2.2GB (and not leaving anything left)

I looked into the file. The first statement ist from  
EndTime=Wed, 29 Jan 2020 11:39:29 CET

So it seems the log is not rotated. Since the log lies in /tmp I assume that this should not be filled at all to this level.

What can I do to get rid of this log (it does not seem to contain any useful data for normal operations) or that this gets rotated/truncated appropriately

Regards Michael

---

<div class="post-metadata">

**Author:** ![valentin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/valentin/32/275_2.png) [@valentin](https://forum.opensearch.org/u/valentin)\
**Post date:** [August 10, 2020, 7:17am UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434/2 "2020-08-10T07:17:24Z")

</div>

We are running into the same issue.

It seems more or less a bug.

---

<div class="post-metadata">

**Author:** ![yojs](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/yojs/32/194_2.png) [@yojs](https://forum.opensearch.org/u/yojs)\
**Post date:** [August 13, 2020, 11:44pm UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434/3 "2020-08-13T23:44:27Z")

</div>

Thanks for reporting the issue. We will look into this.

---

<div class="post-metadata">

**Author:** ![micha](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@micha](https://forum.opensearch.org/u/micha)\
**Post date:** [October 26, 2020, 9:14am UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434/4 "2020-10-26T09:14:49Z")

</div>

Hi,

We still have this problem and are in need to manually delete and restart the whole cluster.  
Is there any effort or new information available? When will this be fixed? (or is there a configuration change possible)?

Regards Michael

---

<div class="post-metadata">

**Author:** ![aae](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@aae](https://forum.opensearch.org/u/aae)\
**Post date:** [January 4, 2021, 7:39pm UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434/5 "2021-01-04T19:39:59Z")

</div>

would also like to bring attention to this issue, is there documentation somewhere that will help us configure automatic rotation of the performance analyzer logs?

kinda wondering if these are even needed if we have `/dev/shm/performanceanalyzer`

---

<div class="post-metadata">

**Author:** ![beagle](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/beagle/32/1069_2.png) [@beagle](https://forum.opensearch.org/u/beagle)\
**Post date:** [February 1, 2021, 3:02pm UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434/6 "2021-02-01T15:02:55Z")

</div>

We have this exact same issue.

Is there really no info or acknowledgement of this issue? Or a potential good fix?

---

<div class="post-metadata">

**Author:** ![clsa](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/clsa/32/582_2.png) [@clsa](https://forum.opensearch.org/u/clsa)\
**Post date:** [February 1, 2021, 4:00pm UTC](https://forum.opensearch.org/t/performance-analyzer-logs-not-rotated/3434/7 "2021-02-01T16:00:55Z")

</div>

I changed `/usr/share/elasticsearch/performance-analyzer-rca/pa_config/log4j2.xml` to

```auto
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
        </Console>
        <RollingFile name="PerformanceAnalyzerLog" fileName="/tmp/PerformanceAnalyzer.log" filePattern="/tmp/PerformanceAnalyzer-%i.log.gz" immediateFlush="true" append="true">
            <PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [PA:Reader] [%t] %-5level %logger{36} - %msg%n"/>
            <Policies>
                <SizeBasedTriggeringPolicy size="100 MB"/>
            </Policies>
            <DefaultRolloverStrategy max="5"/>
        </RollingFile>
        <File name="StatsLog" fileName="/tmp/performance_analyzer_agent_stats.log" immediateFlush="true" append="true">
        </File>
    </Appenders>
    <Loggers>
        <Logger name="stats_log" level="info" additivity="false">
            <AppenderRef ref="StatsLog"/>
        </Logger>
        <Root level="error">
            <AppenderRef ref="Console" />
            <AppenderRef ref="PerformanceAnalyzerLog"/>
        </Root>
    </Loggers>
</Configuration>

```

Logs now get rotated and zipped when they are 100M

```auto
# ls -rtlh /tmp/PerformanceAnalyzer*
-rw-r--r-- 1 elasticsearch elasticsearch 1.7M Jan 31 23:21 /tmp/PerformanceAnalyzer-1.log.gz
-rw-r--r-- 1 elasticsearch elasticsearch 1.7M Feb 1 03:24 /tmp/PerformanceAnalyzer-2.log.gz
-rw-r--r-- 1 elasticsearch elasticsearch 1.7M Feb 1 07:27 /tmp/PerformanceAnalyzer-3.log.gz
-rw-r--r-- 1 elasticsearch elasticsearch 1.7M Feb 1 11:31 /tmp/PerformanceAnalyzer-4.log.gz
-rw-r--r-- 1 elasticsearch elasticsearch 1.7M Feb 1 15:34 /tmp/PerformanceAnalyzer-5.log.gz
-rw-r--r-- 1 elasticsearch elasticsearch 11M Feb 1 15:59 /tmp/PerformanceAnalyzer.log

```
