<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Enabling python log rollover in splunk in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/688852#M11505</link>
    <description>&lt;P&gt;According to your reply and&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Troubleshooting/WhatSplunklogsaboutitself" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Troubleshooting/WhatSplunklogsaboutitself&lt;/A&gt;&amp;nbsp;splunk does not mange python.log rotation, but then how it is being rotated?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I've made python.log around 100MB with stopped splunk service and the python.log was NOT rotated. Once I've started splunk, log was immediately&amp;nbsp;rotated to python.log.1, additionally the newly created python.log (size only few bites) I've also made it well over 25MB and it was rotated once again.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2024 09:27:46 GMT</pubDate>
    <dc:creator>dstoev</dc:creator>
    <dc:date>2024-05-28T09:27:46Z</dc:date>
    <item>
      <title>Enabling python log rollover in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48102#M629</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I need to provide the rollover policy for the python log file present in the /opt/splunk/var/log/splunk directory. I tried adding the following stanza in log.cfg:&lt;/P&gt;

&lt;P&gt;[python]&lt;/P&gt;

&lt;P&gt;splunk = INFO&lt;/P&gt;

&lt;P&gt;splunk.appserver = INFO&lt;/P&gt;

&lt;P&gt;splunk.appserver.controllers = INFO&lt;/P&gt;

&lt;P&gt;splunk.appserver.lib = WARN&lt;/P&gt;

&lt;P&gt;appender.python=RollingFileAppender&lt;/P&gt;

&lt;P&gt;appender.python.fileName=${SPLUNK_HOME}/var/log/splunk/python.log&lt;/P&gt;

&lt;P&gt;appender.python.maxFileSize=1000 # default: 25MB (specified in bytes).&lt;/P&gt;

&lt;P&gt;appender.python.maxBackupIndex=20&lt;/P&gt;

&lt;P&gt;appender.python.layout=PatternLayout&lt;/P&gt;

&lt;P&gt;appender.python.layout.ConversionPattern=%d{%m-%d-%Y %H:%M:%S.%l %z} %-5p %c - %m%n&lt;/P&gt;

&lt;P&gt;category.PythonLogger=INFO,python&lt;/P&gt;

&lt;P&gt;After these changes, I got the error: &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;2013-03-01 15:04:53,825 ERROR   [5130763d33de8c610] root:544 - 'module' object has no attribute 'ROLLINGFILEAPPENDER'&lt;BR /&gt;
Traceback (most recent call last):&lt;BR /&gt;
  File "/opt/splunk/lib/python2.7/site-packages/splunk/appserver/mrsparkle/root.py", line 96, in &lt;MODULE&gt;&lt;BR /&gt;
    splunk.setupSplunkLogger(logger, LOGGING_DEFAULT_CONFIG_FILE, LOGGING_LOCAL_CONFIG_FILE, LOGGING_STANZA_NAME)&lt;BR /&gt;
  File "/opt/splunk/lib/python2.7/site-packages/splunk/&lt;STRONG&gt;init&lt;/STRONG&gt;.py", line 146, in setupSplunkLogger&lt;BR /&gt;
    logging.getLogger(loggerName).setLevel(getattr(logging, level))&lt;BR /&gt;
AttributeError: 'module' object has no attribute 'ROLLINGFILEAPPENDER'&lt;/MODULE&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I tried changing the category.PythonLogger=INFO,python to category.PythonLogger=INFO,A5 and also A2 but still I faced same issue. Can someone please help me with this.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48102#M629</guid>
      <dc:creator>keerthana_k</dc:creator>
      <dc:date>2020-09-28T13:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling python log rollover in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48103#M630</link>
      <description>&lt;P&gt;Hi Keerthana,&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/view/splunk-extensions/SP-CAAAEA9"&gt;http://dev.splunk.com/view/splunk-extensions/SP-CAAAEA9&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Apr 2013 12:17:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48103#M630</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2013-04-14T12:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling python log rollover in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48104#M631</link>
      <description>&lt;P&gt;&lt;A href="http://dev.splunk.com/view/splunk-extensions/SP-CAAAEA9"&gt;http://dev.splunk.com/view/splunk-extensions/SP-CAAAEA9&lt;/A&gt;. &lt;/P&gt;

&lt;P&gt;It works&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2013 19:01:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48104#M631</guid>
      <dc:creator>strive</dc:creator>
      <dc:date>2013-06-06T19:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling python log rollover in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48105#M632</link>
      <description>&lt;P&gt;As of today, Splunk does not be designed for Python log rotation since to support python log rotation some design level changes are required and that cannot be done in maintenance releases. If you force to configure it, SplunkWed won't start correctly once you restart Splunk instance. Also you will see following error in web_services.log.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-04-04 15:56:02,928 ERROR   [58e34382a0701d2955c0] root:814 - 'module' object has no attribute '10' 
Traceback (most recent call last): 
File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\root.py", line 90, in &amp;lt;module&amp;gt; 
splunk.setupSplunkLogger(logger, LOGGING_DEFAULT_CONFIG_FILE, LOGGING_LOCAL_CONFIG_FILE, LOGGING_STANZA_NAME) 
File "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\__init__.py", line 154, in setupSplunkLogger 
logging.getLogger(loggerName).setLevel(getattr(logging, level)) 
AttributeError: 'module' object has no attribute '10' 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you need this feature, you can open a new support case as an Enhancement Request.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 08:58:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/48105#M632</guid>
      <dc:creator>CurryPan</dc:creator>
      <dc:date>2017-04-26T08:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Enabling python log rollover in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/688852#M11505</link>
      <description>&lt;P&gt;According to your reply and&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Troubleshooting/WhatSplunklogsaboutitself" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Troubleshooting/WhatSplunklogsaboutitself&lt;/A&gt;&amp;nbsp;splunk does not mange python.log rotation, but then how it is being rotated?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I've made python.log around 100MB with stopped splunk service and the python.log was NOT rotated. Once I've started splunk, log was immediately&amp;nbsp;rotated to python.log.1, additionally the newly created python.log (size only few bites) I've also made it well over 25MB and it was rotated once again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 09:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Enabling-python-log-rollover-in-splunk/m-p/688852#M11505</guid>
      <dc:creator>dstoev</dc:creator>
      <dc:date>2024-05-28T09:27:46Z</dc:date>
    </item>
  </channel>
</rss>

