<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Swatchdog &#8211; Simple Log File Watcher in Real-Time in Linux	</title>
	<atom:link href="https://www.tecmint.com/swatch-linux-log-file-watcher/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecmint.com/swatch-linux-log-file-watcher/</link>
	<description>Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks.</description>
	<lastBuildDate>Fri, 12 Feb 2021 09:17:28 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Bernd		</title>
		<link>https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1433873</link>

		<dc:creator><![CDATA[Bernd]]></dc:creator>
		<pubDate>Fri, 12 Feb 2021 09:17:28 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=30180#comment-1433873</guid>

					<description><![CDATA[Hello,

The call with &lt;code&gt;--Daemon&lt;/code&gt; must be made with &lt;code&gt;-c&lt;/code&gt;.
&lt;pre&gt;
old: $ swatchdog ~ / swatch / secure.conf -t / var / log / secure --daemon
correct: $ swatchdog -c ~ / swatch / secure.conf -t / var / log / secure --daemon 
&lt;/pre&gt;
Otherwise he will not find the config file]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>The call with <code>--Daemon</code> must be made with <code>-c</code>.</p>
<pre>
old: $ swatchdog ~ / swatch / secure.conf -t / var / log / secure --daemon
correct: $ swatchdog -c ~ / swatch / secure.conf -t / var / log / secure --daemon 
</pre>
<p>Otherwise he will not find the config file</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nnsense		</title>
		<link>https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1306355</link>

		<dc:creator><![CDATA[nnsense]]></dc:creator>
		<pubDate>Sun, 15 Dec 2019 01:37:57 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=30180#comment-1306355</guid>

					<description><![CDATA[About the above discussion, swatchdog can be reloaded automatically by using `&lt;code&gt;--restart-time=&lt;/code&gt;`, and then you might add `&lt;code&gt;--tail-args&lt;/code&gt;` to pass `&lt;code&gt;-T -n1&lt;/code&gt;` to force tail to reload  a non-existent file (tailing only one line at a time). 

`&lt;code&gt;swatch --awk-field-syntax --tail-args &quot;-n1 -F&quot; --restart-time=00:00 /opt/blackboard/logs/tomcat/stdout-stderr-$(%Y%m%d).log&lt;/code&gt;`]]></description>
			<content:encoded><![CDATA[<p>About the above discussion, swatchdog can be reloaded automatically by using `<code>--restart-time=</code>`, and then you might add `<code>--tail-args</code>` to pass `<code>-T -n1</code>` to force tail to reload  a non-existent file (tailing only one line at a time). </p>
<p>`<code>swatch --awk-field-syntax --tail-args "-n1 -F" --restart-time=00:00 /opt/blackboard/logs/tomcat/stdout-stderr-$(%Y%m%d).log</code>`</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aaron Kili		</title>
		<link>https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1020383</link>

		<dc:creator><![CDATA[Aaron Kili]]></dc:creator>
		<pubDate>Thu, 02 Aug 2018 16:24:25 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=30180#comment-1020383</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1020234&quot;&gt;Rosalind Benoit&lt;/a&gt;.

@Rosalind

&quot;One thing I thought of would be to put the swatch command in its own script which uses variables to define the right filename (ex. dateString={date +”%m-%d”//[-]/} tailString= ‘/opt/blackboard/logs/tomcat/stdout-stderr’+$dateString+’.log’) and then run that swatchdog script every day.&quot;

This is the possible solution, and you have to deal with the system overhead, because as long as your threaded java app continues to run, then the swatchdog script also needs to continue running to watch stuck threads. The simple idea is continuous monitoring of a file using swatchdog, this definitely causes system overhead.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1020234">Rosalind Benoit</a>.</p>
<p>@Rosalind</p>
<p>&#8220;One thing I thought of would be to put the swatch command in its own script which uses variables to define the right filename (ex. dateString={date +”%m-%d”//[-]/} tailString= ‘/opt/blackboard/logs/tomcat/stdout-stderr’+$dateString+’.log’) and then run that swatchdog script every day.&#8221;</p>
<p>This is the possible solution, and you have to deal with the system overhead, because as long as your threaded java app continues to run, then the swatchdog script also needs to continue running to watch stuck threads. The simple idea is continuous monitoring of a file using swatchdog, this definitely causes system overhead.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rosalind Benoit		</title>
		<link>https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1020234</link>

		<dc:creator><![CDATA[Rosalind Benoit]]></dc:creator>
		<pubDate>Wed, 01 Aug 2018 23:06:56 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=30180#comment-1020234</guid>

					<description><![CDATA[I just started using Swatch(dog) today on rhel and am psyched as I was originally going to have to reinvent the wheel here. Can you help me with one thing? I need to tail a specific logfile and watch for a string indicating that there may be stuck threads in my threaded java app. 

Then I&#039;ll execute a script to generate thread dumps if the string is found. All good, but the only problem is, the name of the logfile changes every day, as the current date is appended to the filename. So what I want is to be able to add:
&lt;code&gt;
swatch --config-file=/home/myuser/swatch/td-swatch-config --tail-file=/my/app/path/logs/tomcat/stdout-stderr-********.log --daemon
&lt;/code&gt;
to cron and have it always know to tail today&#039;s log, whether it be &lt;strong&gt;stdout-stderr-20180801.log&lt;/strong&gt; or &lt;strong&gt;stdout-stderr-20190101.log&lt;/strong&gt;, etc. 

Can you help me with that? Is there an easy way? One thing I thought of would be to put the swatch command in its own script which uses variables to define the right filename (ex. dateString={date +&quot;%m-%d&quot;//[-]/}  tailString= &#039;/opt/blackboard/logs/tomcat/stdout-stderr&#039;+$dateString+&#039;.log&#039;) and then run that swatchdog script every day. But then is there more overhead on effectively killing the swatchdog process when it no longer needs to be watching a file that won&#039;t change anymore?

Advise pretty please : )]]></description>
			<content:encoded><![CDATA[<p>I just started using Swatch(dog) today on rhel and am psyched as I was originally going to have to reinvent the wheel here. Can you help me with one thing? I need to tail a specific logfile and watch for a string indicating that there may be stuck threads in my threaded java app. </p>
<p>Then I&#8217;ll execute a script to generate thread dumps if the string is found. All good, but the only problem is, the name of the logfile changes every day, as the current date is appended to the filename. So what I want is to be able to add:<br />
<code><br />
swatch --config-file=/home/myuser/swatch/td-swatch-config --tail-file=/my/app/path/logs/tomcat/stdout-stderr-********.log --daemon<br />
</code><br />
to cron and have it always know to tail today&#8217;s log, whether it be <strong>stdout-stderr-20180801.log</strong> or <strong>stdout-stderr-20190101.log</strong>, etc. </p>
<p>Can you help me with that? Is there an easy way? One thing I thought of would be to put the swatch command in its own script which uses variables to define the right filename (ex. dateString={date +&#8221;%m-%d&#8221;//[-]/}  tailString= &#8216;/opt/blackboard/logs/tomcat/stdout-stderr&#8217;+$dateString+&#8217;.log&#8217;) and then run that swatchdog script every day. But then is there more overhead on effectively killing the swatchdog process when it no longer needs to be watching a file that won&#8217;t change anymore?</p>
<p>Advise pretty please : )</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ravi Saive		</title>
		<link>https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1020076</link>

		<dc:creator><![CDATA[Ravi Saive]]></dc:creator>
		<pubDate>Wed, 01 Aug 2018 08:44:33 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=30180#comment-1020076</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1020073&quot;&gt;neo&lt;/a&gt;.

@Neo,

That&#039;s not enough, because Swatchdog uses regular expression and pattern to monitor particular string in a log file, also it has a feature to highlight those string in bold or color fashion in the output.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/swatch-linux-log-file-watcher/comment-page-1/#comment-1020073">neo</a>.</p>
<p>@Neo,</p>
<p>That&#8217;s not enough, because Swatchdog uses regular expression and pattern to monitor particular string in a log file, also it has a feature to highlight those string in bold or color fashion in the output.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
