[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openmrs-dev
Subject:    Re: Logging issues with openmrs
From:       Darius Jazayeri <darius () openmrs ! org>
Date:       2012-11-30 20:20:35
Message-ID: CAA-nHndHJk_zbhMB7Ee_RJq7+HPjQoGiY4aB0LinSMfxFf+14A () mail ! gmail ! com
[Download RAW message or body]

Hi Yan,

Lluis's (and my) point is that if you're trying to do this during the
software development process (as opposed to needing to log these details in
a production system), then the debugger with breakpoints is definitely the
right tool (as opposed to running with log statements).

If you're not familiar with how to do this, hop on the OpenMRS IRC channel
( https://wiki.openmrs.org/x/EQAP ) and see if someone can help you with it.

-Darius


On Fri, Nov 30, 2012 at 10:05 AM, Yan Jin <kimyeon824@gmail.com> wrote:

> Thanks for all your suggestions! They are all helpful and I will try them
> out until I find a way to best fit my debugging purpose.
>
> The purpose I'm doing debug is 1) to see whether the
> DssServiceImpl.runRule is actually called or triggered 2) to look at the
> process of runRule execution 3) to look at some intermediate result of rule
> evaluation, for example, I'd like to print out the age restriction of the
> rule or the conclusion of the logic part of the rule which would be true or
> false.
>
>
> Yan Jin
>
>
>
> On Fri, Nov 30, 2012 at 7:16 AM, Darius Jazayeri <darius@openmrs.org>wrote:
>
>> To be more explicit, I would expect that you'd use your IDE to put a
>> breakpoint on the first line of RunRulesController.referenceData, and then
>> you'd launch the jetty:run task under the debugger.
>>
>> That's much more powerful for debugging, and much quicker, since you
>> don't have to recompile to add and remove breakpoints.
>>
>> -Darius
>>
>>
>> On Fri, Nov 30, 2012 at 1:36 AM, Lluis Martinez <lluismf@gmail.com>wrote:
>>
>>> Just curious, why do you use logging for debugging purposes ? I mean,
>>> logging is good in production where you can't use an IDE to debug, but
>>> in development it's weird.
>>>
>>> Cheers
>>>
>>> On Fri, Nov 30, 2012 at 6:30 AM, Yan Jin <kimyeon824@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > I'm currently debugging dss rules and have some issues with the
>>> logging.
>>> > Basically, what I did is adding the log.info("some messages."); in
>>> the code
>>> > to see the process of the execution, but I don't get any logging
>>> messages I
>>> > added.
>>> > For example, I have these lines of code:
>>> >
>>> >     protected Map referenceData(HttpServletRequest request) throws
>>> Exception
>>> > {
>>> >         log.info("RunRulesController begins.");
>>> >
>>> > I didn't see the "RunRulesController begins." message even though the
>>> method
>>> > did get called.
>>> >
>>> > Does anybody know what's going on with the logging and how to fix this
>>> > problem? It's really difficult to debug without the logging. So any
>>> > suggestion would be appreciated.
>>> >
>>> > Thanks in advance!
>>> >
>>> > Yan Jin
>>> >
>>> > --
>>> > OpenMRS Developers: http://go.openmrs.org/dev
>>> > Post: dev@openmrs.org
>>> > Unsubscribe: dev+unsubscribe@openmrs.org
>>> > Manage your OpenMRS subscriptions at https://id.openmrs.org/
>>> >
>>> >
>>>
>>> --
>>> OpenMRS Developers: http://go.openmrs.org/dev
>>> Post: dev@openmrs.org
>>> Unsubscribe: dev+unsubscribe@openmrs.org
>>> Manage your OpenMRS subscriptions at https://id.openmrs.org/
>>>
>>>
>>>
>>  --
>> OpenMRS Developers: http://go.openmrs.org/dev
>> Post: dev@openmrs.org
>> Unsubscribe: dev+unsubscribe@openmrs.org
>> Manage your OpenMRS subscriptions at https://id.openmrs.org/
>>
>>
>>
>
>  --
> OpenMRS Developers: http://go.openmrs.org/dev
> Post: dev@openmrs.org
> Unsubscribe: dev+unsubscribe@openmrs.org
> Manage your OpenMRS subscriptions at https://id.openmrs.org/
>
>
>

-- 
OpenMRS Developers: http://go.openmrs.org/dev
Post: dev@openmrs.org
Unsubscribe: dev+unsubscribe@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/



[Attachment #3 (text/html)]

Hi Yan,<div><br></div><div>Lluis&#39;s (and my) point is that if you&#39;re trying to \
do this during the software development process (as opposed to needing to log these \
details in a production system), then the debugger with breakpoints is definitely the \
right tool (as opposed to running with log statements).</div>

<div><br></div><div>If you&#39;re not familiar with how to do this, hop on the \
OpenMRS IRC channel ( <a \
href="https://wiki.openmrs.org/x/EQAP">https://wiki.openmrs.org/x/EQAP</a> ) and see \
if someone can help you with it.</div>

<div><br></div><div>-Darius</div><div class="gmail_extra"><br><br><div \
class="gmail_quote">On Fri, Nov 30, 2012 at 10:05 AM, Yan Jin <span dir="ltr">&lt;<a \
href="mailto:kimyeon824@gmail.com" \
target="_blank">kimyeon824@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Thanks for all your suggestions! They are all helpful and I \
will try them out until I find a way to best fit my debugging purpose. <br>

<br>The purpose I&#39;m doing debug is 1) to see whether the DssServiceImpl.runRule \
is actually called or triggered 2) to look at the process of runRule execution 3) to \
look at some intermediate result of rule evaluation, for example, I&#39;d like to \
print out the age restriction of the rule or the conclusion of the logic part of the \
rule which would be true or false.<span class="HOEnZb"><font color="#888888"><br>


<br></font></span><div class="gmail_extra"><span class="HOEnZb"><font \
color="#888888"><br clear="all">Yan Jin</font></span><div><div class="h5"><br> \
<br><br><div class="gmail_quote">On Fri, Nov 30, 2012 at 7:16 AM, Darius Jazayeri \
<span dir="ltr">&lt;<a href="mailto:darius@openmrs.org" \
target="_blank">darius@openmrs.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">


To be more explicit, I would expect that you&#39;d use your IDE to put a breakpoint \
on the first line of RunRulesController.referenceData, and then you&#39;d launch the \
jetty:run task under the debugger.<div><br></div><div>




That&#39;s much more powerful for debugging, and much quicker, since you don&#39;t \
have to recompile to add and remove breakpoints.<span><font \
color="#888888"><br><div><div><br></div><div>-Darius</div></div> \
</font></span></div><div><div><div class="gmail_extra"><br><br><div \
class="gmail_quote">

On Fri, Nov 30, 2012 at 1:36 AM, Lluis Martinez <span dir="ltr">&lt;<a \
href="mailto:lluismf@gmail.com" target="_blank">lluismf@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">




Just curious, why do you use logging for debugging purposes ? I mean,<br>
logging is good in production where you can&#39;t use an IDE to debug, but<br>
in development it&#39;s weird.<br>
<br>
Cheers<br>
<div><br>
On Fri, Nov 30, 2012 at 6:30 AM, Yan Jin &lt;<a href="mailto:kimyeon824@gmail.com" \
target="_blank">kimyeon824@gmail.com</a>&gt; wrote:<br> </div><div><div>&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m currently debugging dss rules and have some issues with the logging.<br>
&gt; Basically, what I did is adding the <a href="http://log.info" \
target="_blank">log.info</a>(&quot;some messages.&quot;); in the code<br> &gt; to see \
the process of the execution, but I don&#39;t get any logging messages I<br> &gt; \
added.<br> &gt; For example, I have these lines of code:<br>
&gt;<br>
&gt;     protected Map referenceData(HttpServletRequest request) throws Exception<br>
&gt; {<br>
&gt;         <a href="http://log.info" \
target="_blank">log.info</a>(&quot;RunRulesController begins.&quot;);<br> &gt;<br>
&gt; I didn&#39;t see the &quot;RunRulesController begins.&quot; message even though \
the method<br> &gt; did get called.<br>
&gt;<br>
&gt; Does anybody know what&#39;s going on with the logging and how to fix this<br>
&gt; problem? It&#39;s really difficult to debug without the logging. So any<br>
&gt; suggestion would be appreciated.<br>
&gt;<br>
&gt; Thanks in advance!<br>
&gt;<br>
&gt; Yan Jin<br>
&gt;<br>
&gt; --<br>
&gt; OpenMRS Developers: <a href="http://go.openmrs.org/dev" \
target="_blank">http://go.openmrs.org/dev</a><br> &gt; Post: <a \
href="mailto:dev@openmrs.org" target="_blank">dev@openmrs.org</a><br> &gt; \
Unsubscribe: <a href="mailto:dev%2Bunsubscribe@openmrs.org" \
target="_blank">dev+unsubscribe@openmrs.org</a><br> &gt; Manage your OpenMRS \
subscriptions at <a href="https://id.openmrs.org/" \
target="_blank">https://id.openmrs.org/</a><br> &gt;<br>
&gt;<br>
<br>
--<br>
OpenMRS Developers: <a href="http://go.openmrs.org/dev" \
                target="_blank">http://go.openmrs.org/dev</a><br>
Post: <a href="mailto:dev@openmrs.org" target="_blank">dev@openmrs.org</a><br>
Unsubscribe: <a href="mailto:dev%2Bunsubscribe@openmrs.org" \
target="_blank">dev+unsubscribe@openmrs.org</a><br> Manage your OpenMRS subscriptions \
at <a href="https://id.openmrs.org/" target="_blank">https://id.openmrs.org/</a><br> \
<br> <br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br>
OpenMRS Developers: <a href="http://go.openmrs.org/dev" \
                target="_blank">http://go.openmrs.org/dev</a><br>
Post: <a href="mailto:dev@openmrs.org" target="_blank">dev@openmrs.org</a><br>
Unsubscribe: <a href="mailto:dev%2Bunsubscribe@openmrs.org" \
target="_blank">dev+unsubscribe@openmrs.org</a><br> Manage your OpenMRS subscriptions \
at <a href="https://id.openmrs.org/" target="_blank">https://id.openmrs.org/</a><br>  \
<br>  <br>
</div></div></blockquote></div><br></div></div></div><div class="HOEnZb"><div \
class="h5">

<p></p>

-- <br>
OpenMRS Developers: <a href="http://go.openmrs.org/dev" \
                target="_blank">http://go.openmrs.org/dev</a><br>
Post: <a href="mailto:dev@openmrs.org" target="_blank">dev@openmrs.org</a><br>
Unsubscribe: <a href="mailto:dev%2Bunsubscribe@openmrs.org" \
target="_blank">dev+unsubscribe@openmrs.org</a><br> Manage your OpenMRS subscriptions \
at <a href="https://id.openmrs.org/" target="_blank">https://id.openmrs.org/</a><br>  \
<br>  <br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
OpenMRS Developers: <a \
                href="http://go.openmrs.org/dev">http://go.openmrs.org/dev</a><br />
Post: dev@openmrs.org<br />
Unsubscribe: dev+unsubscribe@openmrs.org<br />
Manage your OpenMRS subscriptions at <a \
href="https://id.openmrs.org/">https://id.openmrs.org/</a><br /> &nbsp;<br />
&nbsp;<br />



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic