You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "javastuff.sam@gmail.com" <ja...@gmail.com> on 2017/01/19 20:21:06 UTC

REST servive command LOG

Hi,

I find LOG command very useful. Periodic metrics and topology change
information helps monitoring. 

However it does not work with my application, It fails with below message -
"Request parameter 'path' must contain a path to valid log file."

My application already using Log4j, so not using Ignite configuration XML to
configure Ignite logging. Instead application log4j configured to push all
Ignite INFO logs to a separate rolling file. Logging works fine. But 

1. Ignite configuration does not have logging configuration details.
2. Log files can be anywhere, not under IGNITE_HOME

And because of above 2 points LOG command fails.

How can I make it work? 

Thanks,
-Sam







 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-servive-command-LOG-tp10148.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: REST servive command LOG

Posted by Denis Magda <dm...@apache.org>.
I see, sorry for confusion. I though this is a new PR :)

—
Denis

> On Jan 23, 2017, at 1:13 PM, Saikat Maitra <sa...@gmail.com> wrote:
> 
> Hi Denis,
> 
> The changes are already merged long time back and I wanted to share the old jira ticket and PR for reference.
> 
> Regards
> Saikat
> 
> On Mon, Jan 23, 2017 at 1:33 PM, Denis Magda <dmagda@apache.org <ma...@apache.org>> wrote:
> Saikat, 
> 
> Could you create a JIRA ticket providing more info why the modifications are required and paste a link to the pull-request there?
> 
> Otherwise the dev community might miss your changes.
> 
> —
> Denis
> 
>> On Jan 22, 2017, at 10:16 AM, Saikat Maitra <saikat.maitra@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Hello Sam,
>> 
>> Due to security reason the log file need to be chrooted to IGNITE_HOME/log.
>> 
>> Please review this PR for the fix.
>> 
>> https://github.com/apache/ignite/pull/420 <https://github.com/apache/ignite/pull/420>
>> 
>> Regards,
>> Saikat
>> 
>> 
>> On Sun, Jan 22, 2017 at 12:03 PM, Saikat Maitra <saikat.maitra@gmail.com <ma...@gmail.com>> wrote:
>> Hi Sam,
>> 
>> You can pass path as query param to get the log details. Please see this jira ticket below for reference.
>> 
>> https://issues.apache.org/jira/browse/IGNITE-944 <https://issues.apache.org/jira/browse/IGNITE-944>
>> 
>> Regards
>> Saikat
>> 
>> On Thu, Jan 19, 2017 at 2:21 PM, javastuff.sam@gmail.com <ma...@gmail.com> <javastuff.sam@gmail.com <ma...@gmail.com>> wrote:
>> Hi,
>> 
>> I find LOG command very useful. Periodic metrics and topology change
>> information helps monitoring.
>> 
>> However it does not work with my application, It fails with below message -
>> "Request parameter 'path' must contain a path to valid log file."
>> 
>> My application already using Log4j, so not using Ignite configuration XML to
>> configure Ignite logging. Instead application log4j configured to push all
>> Ignite INFO logs to a separate rolling file. Logging works fine. But
>> 
>> 1. Ignite configuration does not have logging configuration details.
>> 2. Log files can be anywhere, not under IGNITE_HOME
>> 
>> And because of above 2 points LOG command fails.
>> 
>> How can I make it work?
>> 
>> Thanks,
>> -Sam
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-servive-command-LOG-tp10148.html <http://apache-ignite-users.70518.x6.nabble.com/REST-servive-command-LOG-tp10148.html>
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com <http://nabble.com/>.
>> 
>> 
> 
> 


Re: REST servive command LOG

Posted by Saikat Maitra <sa...@gmail.com>.
Hi Denis,

The changes are already merged long time back and I wanted to share the old
jira ticket and PR for reference.

Regards
Saikat

On Mon, Jan 23, 2017 at 1:33 PM, Denis Magda <dm...@apache.org> wrote:

> Saikat,
>
> Could you create a JIRA ticket providing more info why the modifications
> are required and paste a link to the pull-request there?
>
> Otherwise the dev community might miss your changes.
>
> —
> Denis
>
> On Jan 22, 2017, at 10:16 AM, Saikat Maitra <sa...@gmail.com>
> wrote:
>
> Hello Sam,
>
> Due to security reason the log file need to be chrooted to
> IGNITE_HOME/log.
>
> Please review this PR for the fix.
>
> https://github.com/apache/ignite/pull/420
>
> Regards,
> Saikat
>
>
> On Sun, Jan 22, 2017 at 12:03 PM, Saikat Maitra <sa...@gmail.com>
> wrote:
>
>> Hi Sam,
>>
>> You can pass path as query param to get the log details. Please see this
>> jira ticket below for reference.
>>
>> https://issues.apache.org/jira/browse/IGNITE-944
>>
>> Regards
>> Saikat
>>
>> On Thu, Jan 19, 2017 at 2:21 PM, javastuff.sam@gmail.com <
>> javastuff.sam@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I find LOG command very useful. Periodic metrics and topology change
>>> information helps monitoring.
>>>
>>> However it does not work with my application, It fails with below
>>> message -
>>> "Request parameter 'path' must contain a path to valid log file."
>>>
>>> My application already using Log4j, so not using Ignite configuration
>>> XML to
>>> configure Ignite logging. Instead application log4j configured to push
>>> all
>>> Ignite INFO logs to a separate rolling file. Logging works fine. But
>>>
>>> 1. Ignite configuration does not have logging configuration details.
>>> 2. Log files can be anywhere, not under IGNITE_HOME
>>>
>>> And because of above 2 points LOG command fails.
>>>
>>> How can I make it work?
>>>
>>> Thanks,
>>> -Sam
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://apache-ignite-users.705
>>> 18.x6.nabble.com/REST-servive-command-LOG-tp10148.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>>
>>
>>
>
>

Re: REST servive command LOG

Posted by Denis Magda <dm...@apache.org>.
Saikat, 

Could you create a JIRA ticket providing more info why the modifications are required and paste a link to the pull-request there?

Otherwise the dev community might miss your changes.

—
Denis

> On Jan 22, 2017, at 10:16 AM, Saikat Maitra <sa...@gmail.com> wrote:
> 
> Hello Sam,
> 
> Due to security reason the log file need to be chrooted to IGNITE_HOME/log.
> 
> Please review this PR for the fix.
> 
> https://github.com/apache/ignite/pull/420 <https://github.com/apache/ignite/pull/420>
> 
> Regards,
> Saikat
> 
> 
> On Sun, Jan 22, 2017 at 12:03 PM, Saikat Maitra <saikat.maitra@gmail.com <ma...@gmail.com>> wrote:
> Hi Sam,
> 
> You can pass path as query param to get the log details. Please see this jira ticket below for reference.
> 
> https://issues.apache.org/jira/browse/IGNITE-944 <https://issues.apache.org/jira/browse/IGNITE-944>
> 
> Regards
> Saikat
> 
> On Thu, Jan 19, 2017 at 2:21 PM, javastuff.sam@gmail.com <ma...@gmail.com> <javastuff.sam@gmail.com <ma...@gmail.com>> wrote:
> Hi,
> 
> I find LOG command very useful. Periodic metrics and topology change
> information helps monitoring.
> 
> However it does not work with my application, It fails with below message -
> "Request parameter 'path' must contain a path to valid log file."
> 
> My application already using Log4j, so not using Ignite configuration XML to
> configure Ignite logging. Instead application log4j configured to push all
> Ignite INFO logs to a separate rolling file. Logging works fine. But
> 
> 1. Ignite configuration does not have logging configuration details.
> 2. Log files can be anywhere, not under IGNITE_HOME
> 
> And because of above 2 points LOG command fails.
> 
> How can I make it work?
> 
> Thanks,
> -Sam
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-servive-command-LOG-tp10148.html <http://apache-ignite-users.70518.x6.nabble.com/REST-servive-command-LOG-tp10148.html>
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
> 
> 


Re: REST servive command LOG

Posted by Saikat Maitra <sa...@gmail.com>.
Hello Sam,

Due to security reason the log file need to be chrooted to IGNITE_HOME/log.

Please review this PR for the fix.

https://github.com/apache/ignite/pull/420

Regards,
Saikat


On Sun, Jan 22, 2017 at 12:03 PM, Saikat Maitra <sa...@gmail.com>
wrote:

> Hi Sam,
>
> You can pass path as query param to get the log details. Please see this
> jira ticket below for reference.
>
> https://issues.apache.org/jira/browse/IGNITE-944
>
> Regards
> Saikat
>
> On Thu, Jan 19, 2017 at 2:21 PM, javastuff.sam@gmail.com <
> javastuff.sam@gmail.com> wrote:
>
>> Hi,
>>
>> I find LOG command very useful. Periodic metrics and topology change
>> information helps monitoring.
>>
>> However it does not work with my application, It fails with below message
>> -
>> "Request parameter 'path' must contain a path to valid log file."
>>
>> My application already using Log4j, so not using Ignite configuration XML
>> to
>> configure Ignite logging. Instead application log4j configured to push all
>> Ignite INFO logs to a separate rolling file. Logging works fine. But
>>
>> 1. Ignite configuration does not have logging configuration details.
>> 2. Log files can be anywhere, not under IGNITE_HOME
>>
>> And because of above 2 points LOG command fails.
>>
>> How can I make it work?
>>
>> Thanks,
>> -Sam
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/REST-servive-command-LOG-tp10148.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>

Re: REST servive command LOG

Posted by Saikat Maitra <sa...@gmail.com>.
Hi Sam,

You can pass path as query param to get the log details. Please see this
jira ticket below for reference.

https://issues.apache.org/jira/browse/IGNITE-944

Regards
Saikat

On Thu, Jan 19, 2017 at 2:21 PM, javastuff.sam@gmail.com <
javastuff.sam@gmail.com> wrote:

> Hi,
>
> I find LOG command very useful. Periodic metrics and topology change
> information helps monitoring.
>
> However it does not work with my application, It fails with below message -
> "Request parameter 'path' must contain a path to valid log file."
>
> My application already using Log4j, so not using Ignite configuration XML
> to
> configure Ignite logging. Instead application log4j configured to push all
> Ignite INFO logs to a separate rolling file. Logging works fine. But
>
> 1. Ignite configuration does not have logging configuration details.
> 2. Log files can be anywhere, not under IGNITE_HOME
>
> And because of above 2 points LOG command fails.
>
> How can I make it work?
>
> Thanks,
> -Sam
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/REST-servive-command-LOG-tp10148.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: REST service command LOG

Posted by ekraynov <ev...@epam.com>.
Log command of the REST API provides access just for logs of the node where
the service raised.  
Logs can be retrieved from IGNITE_HOME/ or from the path defined in the log
configuration of the node.
Log configuration should be defined expliciltly when Ignite-log4j module is
enabled.
 
XML:
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
  <property name="gridLogger">
    <bean class="org.apache.ignite.logger.log4j.Log4JLogger">
      <constructor-arg type="java.lang.String" value="log4j.xml"/>
    </bean>
  </property>
  
  ...
</bean>
 
 Java:
IgniteConfiguration cfg = new IgniteConfiguration();
IgniteLogger log = new Log4JLogger("log4j.xml");
cfg.setGridLogger(log);
 
In this way, Log command will provide by default (without Path parameter)
logs from the file specified 
in  log4j.xml
 
I think, the current behavior is correct



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: REST service command LOG

Posted by "javastuff.sam@gmail.com" <ja...@gmail.com>.
Created minor ticket IGNITE-4845




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-service-command-LOG-tp10148p11325.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: REST service command LOG

Posted by vkulichenko <va...@gmail.com>.
Hi Sam,

This makes sense to me. Can you create a ticket and put your thoughts there?
Contributions are also very welcome ;)

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-service-command-LOG-tp10148p11162.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: REST service command LOG

Posted by "javastuff.sam@gmail.com" <ja...@gmail.com>.
Hi Val,

Apologies for coming back to this thread late.

I agree for security reasons it should internally figure out which log file
to read. However it does not work, here is the scenario -

Ignite-log4j module is enabled simply including this jar file, now it uses
my application log4j configuration to log successfully. But ignite.log() is
never initialized, it is null, hence REST API not able to figure out where
is the log file. 
I have to enforce either of the workaround - 
1. Log file location need to start with IGNITE_HOME and use Path parameter
in LOG command.
2. Enforce logging into IGNITE_HOME/work/log/ignite.log location.

I think when Ignite-log4j module is enabled it should make Ignite aware of
logging configuration. 

Thanks,
-Sam



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-service-command-LOG-tp10148p11158.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: REST service command LOG

Posted by vkulichenko <va...@gmail.com>.
Sam,

That's actually interesting :) I believe this command behaves this way
because the purpose of the command is to fetch the Ignite log, not any
arbitrary file. On the other hand, logic in GridLogCommandHandler looks
weird and limited. Do you have any ideas about how it SHOULD work?

My current thought is that 'path' parameter actually doesn't make much
sense, and Ignite should always properly pick up the file it writes log to
(this apparently doesn't happen in you scenario). I'm not sure how to deal
with rolling logs in this case though...

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-service-command-LOG-tp10148p10164.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: REST service command LOG

Posted by "javastuff.sam@gmail.com" <ja...@gmail.com>.
No, it does not work. It tries to look for file
$IGNITE_HOME/work/log/ignite.log. Code seems to have "/work/log/ignite.log"
as default log file.

Since Ignite configuration does not have logging details, best bet I thought
was specifying path.

Thanks,
-Sam 
 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-service-command-LOG-tp10148p10160.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: REST service command LOG

Posted by vkulichenko <va...@gmail.com>.
Sam,

What if you does not provide the 'path' parameter? Does it work?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/REST-service-command-LOG-tp10148p10159.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.