<?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: Log4j creates multiple log files when only wanting one in Windchill Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830828#M2843</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/307211"&gt;@berny2U&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to add that I set my background server by my own settings called&amp;nbsp;&lt;FONT color="#008080"&gt;BGMethodServer&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This is a reason why you see different setting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The point is to set&amp;nbsp;&lt;STRONG&gt;-Dlog4j2.configurationFile\&lt;/STRONG&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;STRONG&gt;$(wt.method.log4j.config)&amp;nbsp;&lt;/STRONG&gt; separately to a background method server.&lt;/P&gt;
&lt;P&gt;This can be little bit complicated but it is possible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in your case there is a line with&amp;nbsp;&lt;STRONG&gt;wt.manager.cmd.BackgroundMethodServer=&lt;FONT color="#0000FF"&gt;$(wt.manager.cmd.MethodServer)&lt;/FONT&gt; wt.method.serviceName\={1}&lt;/STRONG&gt;&amp;nbsp;wt.queue.executeQueues\=true wt.queue.queueGroup\={5} wt.intersvrcom.sitePing\=false wt.adapter.enabled\=false wt.method.minPort\=$(wt.method.bg.minPort) wt.method.maxPort\=$(wt.method.bg.maxPort)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to define own variable for&amp;nbsp;&lt;FONT color="#0000FF"&gt;$(wt.manager.cmd.MethodServer)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;All settings started with "&lt;SPAN&gt;$(" pointing to another line where the setting is written as a &lt;STRONG&gt;variable&lt;/STRONG&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in my case I rewrite original setting to my own one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer&lt;/FONT&gt;=&lt;STRONG&gt;$(wt.manager.cmd.BGMethodServer)&lt;/STRONG&gt; wt.method.serviceName\={1} wt.queue.executeQueues\=true wt.queue.queueGroup\={5} wt.intersvrcom.sitePing\=false wt.adapter.enabled\=false wt.method.minPort\=$(wt.method.bg.minPort) wt.method.maxPort\=$(wt.method.bg.maxPort)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer.java.cmd.quoted&lt;/FONT&gt;=$(wt.manager.cmd.MethodServer.java.cmd.quoted)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer.java.extra.args&lt;/FONT&gt;=$(wt.manager.cmd.MethodServer.java.extra.args)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer.param.15&lt;/FONT&gt;=&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServerLauncher&lt;/FONT&gt;=$(wt.manager.cmd.MethodServerLauncher)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BGMethodServer&lt;/FONT&gt;=&lt;STRONG&gt;$(wt.manager.cmd.BGMethodServer.java.command)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BGMethodServer.java.command&lt;/FONT&gt;&lt;/STRONG&gt;=&lt;STRONG&gt;$(wt.java.bgmscmd.quoted)&lt;/STRONG&gt; $(wt.manager.cmd.common.java.args) $(wt.manager.cmd.common.psm.agent.args.MS) &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;-Dlog4j2.configurationFile\=WEB-INF/log4jBackgroundMethod.properties&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;$(wt.manager.cmd.MethodServer.jmx.args) $(wt.manager.cmd.MethodServer.debug.args) {12} -Xms{14}m -Xmx{4}m $(wt.manager.cmd.MethodServer.platform.java.args) {11} wt.method.MethodServerMain&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080"&gt;wt.java.bgmscmd.quoted&lt;/FONT&gt;=&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;$(wt.java.bgmscmd)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080"&gt;wt.java.bgmscmd&lt;/FONT&gt;=&lt;STRONG&gt;C\:\\Windchill_12.0\\Java\\bin\\BackgroundSrv.exe&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the reason of the&amp;nbsp;BackgroundSrv.exe is to see this name in process explorer instead of java.exe. (BackgroundSrv.exe is just copy of java.exe)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PetrH&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2022 14:26:58 GMT</pubDate>
    <dc:creator>HelesicPetr</dc:creator>
    <dc:date>2022-10-17T14:26:58Z</dc:date>
    <item>
      <title>Log4j creates multiple log files when only wanting one</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830528#M2840</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;We have a number of customization api's running in Windchill that take effect when promotion occurs. As this is generating a fair amount of logging I decided to put this in a separated log file.&lt;BR /&gt;I use next configuration for this (log4jMethodServer.properties):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="berny2U_0-1665751882568.png" style="width: 790px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/67163i1AA879FC30D261C1/image-dimensions/790x164?v=v2" width="790" height="164" role="button" title="berny2U_0-1665751882568.png" alt="berny2U_0-1665751882568.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This creates also a log file for both method server processes (javaMS.exe) and one for the background method server (avaBGM.exe). The loggers with id 21024 &amp;amp; 14912 are method server logs that I do not want. The are empty too.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="berny2U_1-1665752238309.png" style="width: 775px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/67166i52768BBF59819A14/image-dimensions/775x157?v=v2" width="775" height="157" role="button" title="berny2U_1-1665752238309.png" alt="berny2U_1-1665752238309.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong to get these extra logfiles for the method servers? I am only interested in deriving the output from original the BM method server to the CustomLogger.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 14:06:42 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830528#M2840</guid>
      <dc:creator>berny2U</dc:creator>
      <dc:date>2024-03-15T14:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Log4j creates multiple log files when only wanting one</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830758#M2841</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/307211"&gt;@berny2U&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is normal behavior, that the log file is created for each MS process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The log4J configuration file applies for all processes so this is the reason that file is created for all of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to create the log file for BacgroundMethod server, you need to separate the log4J configuration for bacgroundMethod server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in wt.properties find following line where cmd definition is configured for bacgroundMS process.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wt.manager.cmd.BGMethodServer.java.command=$(wt.java.bgmscmd.quoted) $(wt.manager.cmd.common.java.args) $(wt.manager.cmd.common.psm.agent.args.MS) &lt;STRONG&gt;-Dlog4j2.configurationFile\&lt;/STRONG&gt;=&lt;STRONG&gt;$(wt.method.log4j.config)&lt;/STRONG&gt; $(wt.manager.cmd.MethodServer.jmx.args) $(wt.manager.cmd.MethodServer.debug.args) {12} -Xms{14}m -Xmx{4}m $(wt.manager.cmd.MethodServer.platform.java.args) {11} wt.method.MethodServerMain&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rewrite the&amp;nbsp;&lt;STRONG&gt;$(wt.method.log4j.config)&amp;nbsp;&lt;/STRONG&gt; to your new separate log4j config file for bacgroundserver proces: example&amp;nbsp;&lt;STRONG&gt;WEB-INF/log4jBackgroundMethod.properties. &lt;/STRONG&gt;In that file you can define your log configuration just for BG.exe.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My suggestion is to create ootb copy of log4jMethodServer.properties file and in the new one add your configuration&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I would say that this change you should do by xconfmanager to propagate this change correctly.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PetrH&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 08:06:09 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830758#M2841</guid>
      <dc:creator>HelesicPetr</dc:creator>
      <dc:date>2022-10-17T08:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Log4j creates multiple log files when only wanting one</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830809#M2842</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/241117"&gt;@HelesicPetr&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;We are at version 12.0.2.6 and do see the commands for the background worker a bit different;&lt;BR /&gt;&lt;BR /&gt;wt.manager.cmd.BackgroundMethodServer=$(wt.manager.cmd.MethodServer) wt.method.serviceName\={1} wt.queue.executeQueues\=true wt.queue.queueGroup\={5} wt.intersvrcom.sitePing\=false wt.adapter.enabled\=false wt.method.minPort\=$(wt.method.bg.minPort) wt.method.maxPort\=$(wt.method.bg.maxPort)&lt;BR /&gt;wt.manager.cmd.BackgroundMethodServer.java.cmd.quoted="$(wt.java.cmdBGM)"&lt;BR /&gt;wt.manager.cmd.BackgroundMethodServer.java.extra.args=-XX\:+DisableExplicitGC&lt;BR /&gt;wt.manager.cmd.BackgroundMethodServerLauncher=$(wt.manager.cmd.MethodServerLauncher)&lt;BR /&gt;&lt;BR /&gt;I am not so experienced in the configuration of Windchill, can you explain what option should be set here ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;BR /&gt;Bernard&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 13:31:11 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830809#M2842</guid>
      <dc:creator>berny2U</dc:creator>
      <dc:date>2022-10-17T13:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Log4j creates multiple log files when only wanting one</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830828#M2843</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/307211"&gt;@berny2U&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to add that I set my background server by my own settings called&amp;nbsp;&lt;FONT color="#008080"&gt;BGMethodServer&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This is a reason why you see different setting.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The point is to set&amp;nbsp;&lt;STRONG&gt;-Dlog4j2.configurationFile\&lt;/STRONG&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;STRONG&gt;$(wt.method.log4j.config)&amp;nbsp;&lt;/STRONG&gt; separately to a background method server.&lt;/P&gt;
&lt;P&gt;This can be little bit complicated but it is possible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in your case there is a line with&amp;nbsp;&lt;STRONG&gt;wt.manager.cmd.BackgroundMethodServer=&lt;FONT color="#0000FF"&gt;$(wt.manager.cmd.MethodServer)&lt;/FONT&gt; wt.method.serviceName\={1}&lt;/STRONG&gt;&amp;nbsp;wt.queue.executeQueues\=true wt.queue.queueGroup\={5} wt.intersvrcom.sitePing\=false wt.adapter.enabled\=false wt.method.minPort\=$(wt.method.bg.minPort) wt.method.maxPort\=$(wt.method.bg.maxPort)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to define own variable for&amp;nbsp;&lt;FONT color="#0000FF"&gt;$(wt.manager.cmd.MethodServer)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;All settings started with "&lt;SPAN&gt;$(" pointing to another line where the setting is written as a &lt;STRONG&gt;variable&lt;/STRONG&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in my case I rewrite original setting to my own one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer&lt;/FONT&gt;=&lt;STRONG&gt;$(wt.manager.cmd.BGMethodServer)&lt;/STRONG&gt; wt.method.serviceName\={1} wt.queue.executeQueues\=true wt.queue.queueGroup\={5} wt.intersvrcom.sitePing\=false wt.adapter.enabled\=false wt.method.minPort\=$(wt.method.bg.minPort) wt.method.maxPort\=$(wt.method.bg.maxPort)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer.java.cmd.quoted&lt;/FONT&gt;=$(wt.manager.cmd.MethodServer.java.cmd.quoted)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer.java.extra.args&lt;/FONT&gt;=$(wt.manager.cmd.MethodServer.java.extra.args)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServer.param.15&lt;/FONT&gt;=&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BackgroundMethodServerLauncher&lt;/FONT&gt;=$(wt.manager.cmd.MethodServerLauncher)&lt;BR /&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BGMethodServer&lt;/FONT&gt;=&lt;STRONG&gt;$(wt.manager.cmd.BGMethodServer.java.command)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#008080"&gt;wt.manager.cmd.BGMethodServer.java.command&lt;/FONT&gt;&lt;/STRONG&gt;=&lt;STRONG&gt;$(wt.java.bgmscmd.quoted)&lt;/STRONG&gt; $(wt.manager.cmd.common.java.args) $(wt.manager.cmd.common.psm.agent.args.MS) &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;-Dlog4j2.configurationFile\=WEB-INF/log4jBackgroundMethod.properties&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;$(wt.manager.cmd.MethodServer.jmx.args) $(wt.manager.cmd.MethodServer.debug.args) {12} -Xms{14}m -Xmx{4}m $(wt.manager.cmd.MethodServer.platform.java.args) {11} wt.method.MethodServerMain&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080"&gt;wt.java.bgmscmd.quoted&lt;/FONT&gt;=&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;$(wt.java.bgmscmd)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008080"&gt;wt.java.bgmscmd&lt;/FONT&gt;=&lt;STRONG&gt;C\:\\Windchill_12.0\\Java\\bin\\BackgroundSrv.exe&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the reason of the&amp;nbsp;BackgroundSrv.exe is to see this name in process explorer instead of java.exe. (BackgroundSrv.exe is just copy of java.exe)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PetrH&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 14:26:58 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/830828#M2843</guid>
      <dc:creator>HelesicPetr</dc:creator>
      <dc:date>2022-10-17T14:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Log4j creates multiple log files when only wanting one</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/831963#M2844</link>
      <description>&lt;P&gt;Thanks Petrh&lt;BR /&gt;That should be ok although i have to learn about this and apply it.&lt;BR /&gt;Regards&lt;BR /&gt;Bernard&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 05:55:27 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Log4j-creates-multiple-log-files-when-only-wanting-one/m-p/831963#M2844</guid>
      <dc:creator>berny2U</dc:creator>
      <dc:date>2022-10-21T05:55:27Z</dc:date>
    </item>
  </channel>
</rss>

