You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Charlin S <ch...@hotelhub.com> on 2025/04/03 12:06:29 UTC

Ignite log4j date not included

Hi All,
Ignite log not included date only time is writing in log file
Sample: [00:05:18,721][WARNING][ignite-update-notifier-timer][GridUpdateNotifier]
Pattern is %d{ISO8601}: This will output the date and time in ISO 8601
format.
And also is possible to write info and warnings in one file and error log
in another file.

Thanks & Regards,
Charlin

Re: Ignite log4j date not included

Posted by Stephen Darlington <sd...@apache.org>.
I'm afraid I'm not a log4j expert. You'd need to check their documentation:
https://logging.apache.org/log4j/2.x/index.html

On Fri, 4 Apr 2025 at 17:53, Charlin S <ch...@hotelhub.com> wrote:

> Hi Stephen,
> Class not found error has been shortened by copy ignite-log4j2 folder from
> optional to libs. RollingFile unable to configure for this
> <File name="INFO_LOG"
> fileName="D:\\IgniteLog\\Test\\logs\\${sys:appId}-INFO-${date:yyyy-MM-dd}-${sys:nodeId}.log">
> <!--2-->
>  <PatternLayout pattern="%d [%t] %p - %m%n"/>
>  <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
>   <Policies>
> <TimeBasedTriggeringPolicy interval="6" modulate="true" />
> <SizeBasedTriggeringPolicy size="2 MB" />
> </Policies>
>     </File>
>
> Thanks,
> Charlin
>
> On Thu, 3 Apr 2025 at 22:08, Charlin S <ch...@hotelhub.com> wrote:
>
>> Hi Stephen,
>> Thanks for your email.
>> I am getting below error after adding gridlogger in springxml
>> Exception has occurred: CLR/Apache.Ignite.Core.Common.IgniteException
>>
>>    -
>>
>> Exception thrown: 'Apache.Ignite.Core.Common.IgniteException' in
>> Apache.Ignite.Core.dll: 'Failed to instantiate configuration from Spring
>> XML: D:\IgniteConfig\dev\grid-client-config-2.16.xml' Inner exceptions
>> found, see $exception in variables window for more details. Innermost
>> exception Apache.Ignite.Core.Common.JavaException : class
>> org.apache.ignite.IgniteException: Failed to instantiate configuration from
>> Spring XML: D:\NGSourceCode\IgniteConfig\dev\grid-client-config-2.16.xml at
>> org.apache.ignite.internal.processors.platform.PlatformIgnition.configuration(PlatformIgnition.java:155)
>> at
>> org.apache.ignite.internal.processors.platform.PlatformIgnition.start(PlatformIgnition.java:67)
>> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
>> instantiate Spring XML application context (make sure all classes used in
>> Spring configuration are present at CLASSPATH)
>> [springUrl=file:/D:/IgniteConfig/dev/grid-client-config-2.16.xml] at
>> org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:396)
>>
>> spring xml
>> <bean class="org.apache.ignite.configuration.IgniteConfiguration">
>> <property name="gridLogger">
>>         <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger">
>>             <!-- log4j2 configuration file -->
>>             <constructor-arg type="java.lang.String"
>> value="config/log4j2-config.xml"/>
>>         </bean>
>>     </property>
>>     <property name="clientMode" value="true"/>
>>     <property name="clientFailureDetectionTimeout" value="120000"/>
>>     <property name="igniteInstanceName" value="dev-2.16"/>
>>     <property name="longQueryWarningTimeout" value="4000"/>
>>     <property name="failureDetectionTimeout" value="120000"/>
>>
>> Thanks,
>> Charlin
>>
>> On Thu, 3 Apr 2025 at 18:03, Stephen Darlington <sd...@apache.org>
>> wrote:
>>
>>> Ignite doesn't use log4j by default, but it can be configured to do so:
>>> https://ignite.apache.org/docs/latest/logging#using-log4j2
>>>
>>> The output format is also configurable. It's certainly possible to
>>> output errors to a different file from info and warnings. That
>>> configuration is not in Ignite but in whichever logger you have enabled.
>>> Here are the docs for log4j:
>>> https://logging.apache.org/log4j/2.x/manual/configuration.html
>>>
>>> On Thu, 3 Apr 2025 at 13:08, Charlin S <ch...@hotelhub.com> wrote:
>>>
>>>> Hi All,
>>>> Ignite log not included date only time is writing in log file
>>>>
>>>> Sample: [00:05:18,721][WARNING][ignite-update-notifier-timer][GridUpdateNotifier]
>>>> Pattern is %d{ISO8601}: This will output the date and time in ISO 8601
>>>> format.
>>>> And also is possible to write info and warnings in one file and error
>>>> log in another file.
>>>>
>>>> Thanks & Regards,
>>>> Charlin
>>>>
>>>>
>>>>

Re: Ignite log4j date not included

Posted by Charlin S <ch...@hotelhub.com>.
Hi Stephen,
Class not found error has been shortened by copy ignite-log4j2 folder from
optional to libs. RollingFile unable to configure for this
<File name="INFO_LOG"
fileName="D:\\IgniteLog\\Test\\logs\\${sys:appId}-INFO-${date:yyyy-MM-dd}-${sys:nodeId}.log">
<!--2-->
 <PatternLayout pattern="%d [%t] %p - %m%n"/>
 <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
  <Policies>
<TimeBasedTriggeringPolicy interval="6" modulate="true" />
<SizeBasedTriggeringPolicy size="2 MB" />
</Policies>
    </File>

Thanks,
Charlin

On Thu, 3 Apr 2025 at 22:08, Charlin S <ch...@hotelhub.com> wrote:

> Hi Stephen,
> Thanks for your email.
> I am getting below error after adding gridlogger in springxml
> Exception has occurred: CLR/Apache.Ignite.Core.Common.IgniteException
>
>    -
>
> Exception thrown: 'Apache.Ignite.Core.Common.IgniteException' in
> Apache.Ignite.Core.dll: 'Failed to instantiate configuration from Spring
> XML: D:\IgniteConfig\dev\grid-client-config-2.16.xml' Inner exceptions
> found, see $exception in variables window for more details. Innermost
> exception Apache.Ignite.Core.Common.JavaException : class
> org.apache.ignite.IgniteException: Failed to instantiate configuration from
> Spring XML: D:\NGSourceCode\IgniteConfig\dev\grid-client-config-2.16.xml at
> org.apache.ignite.internal.processors.platform.PlatformIgnition.configuration(PlatformIgnition.java:155)
> at
> org.apache.ignite.internal.processors.platform.PlatformIgnition.start(PlatformIgnition.java:67)
> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
> instantiate Spring XML application context (make sure all classes used in
> Spring configuration are present at CLASSPATH)
> [springUrl=file:/D:/IgniteConfig/dev/grid-client-config-2.16.xml] at
> org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:396)
>
> spring xml
> <bean class="org.apache.ignite.configuration.IgniteConfiguration">
> <property name="gridLogger">
>         <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger">
>             <!-- log4j2 configuration file -->
>             <constructor-arg type="java.lang.String"
> value="config/log4j2-config.xml"/>
>         </bean>
>     </property>
>     <property name="clientMode" value="true"/>
>     <property name="clientFailureDetectionTimeout" value="120000"/>
>     <property name="igniteInstanceName" value="dev-2.16"/>
>     <property name="longQueryWarningTimeout" value="4000"/>
>     <property name="failureDetectionTimeout" value="120000"/>
>
> Thanks,
> Charlin
>
> On Thu, 3 Apr 2025 at 18:03, Stephen Darlington <sd...@apache.org>
> wrote:
>
>> Ignite doesn't use log4j by default, but it can be configured to do so:
>> https://ignite.apache.org/docs/latest/logging#using-log4j2
>>
>> The output format is also configurable. It's certainly possible to output
>> errors to a different file from info and warnings. That configuration is
>> not in Ignite but in whichever logger you have enabled. Here are the docs
>> for log4j: https://logging.apache.org/log4j/2.x/manual/configuration.html
>>
>> On Thu, 3 Apr 2025 at 13:08, Charlin S <ch...@hotelhub.com> wrote:
>>
>>> Hi All,
>>> Ignite log not included date only time is writing in log file
>>>
>>> Sample: [00:05:18,721][WARNING][ignite-update-notifier-timer][GridUpdateNotifier]
>>> Pattern is %d{ISO8601}: This will output the date and time in ISO 8601
>>> format.
>>> And also is possible to write info and warnings in one file and error
>>> log in another file.
>>>
>>> Thanks & Regards,
>>> Charlin
>>>
>>>
>>>

Re: Ignite log4j date not included

Posted by Charlin S <ch...@hotelhub.com>.
Hi Stephen,
Thanks for your email.
I am getting below error after adding gridlogger in springxml
Exception has occurred: CLR/Apache.Ignite.Core.Common.IgniteException

   -

Exception thrown: 'Apache.Ignite.Core.Common.IgniteException' in
Apache.Ignite.Core.dll: 'Failed to instantiate configuration from Spring
XML: D:\IgniteConfig\dev\grid-client-config-2.16.xml' Inner exceptions
found, see $exception in variables window for more details. Innermost
exception Apache.Ignite.Core.Common.JavaException : class
org.apache.ignite.IgniteException: Failed to instantiate configuration from
Spring XML: D:\NGSourceCode\IgniteConfig\dev\grid-client-config-2.16.xml at
org.apache.ignite.internal.processors.platform.PlatformIgnition.configuration(PlatformIgnition.java:155)
at
org.apache.ignite.internal.processors.platform.PlatformIgnition.start(PlatformIgnition.java:67)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to
instantiate Spring XML application context (make sure all classes used in
Spring configuration are present at CLASSPATH)
[springUrl=file:/D:/IgniteConfig/dev/grid-client-config-2.16.xml] at
org.apache.ignite.internal.util.spring.IgniteSpringHelperImpl.applicationContext(IgniteSpringHelperImpl.java:396)

spring xml
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="gridLogger">
        <bean class="org.apache.ignite.logger.log4j2.Log4J2Logger">
            <!-- log4j2 configuration file -->
            <constructor-arg type="java.lang.String"
value="config/log4j2-config.xml"/>
        </bean>
    </property>
    <property name="clientMode" value="true"/>
    <property name="clientFailureDetectionTimeout" value="120000"/>
    <property name="igniteInstanceName" value="dev-2.16"/>
    <property name="longQueryWarningTimeout" value="4000"/>
    <property name="failureDetectionTimeout" value="120000"/>

Thanks,
Charlin

On Thu, 3 Apr 2025 at 18:03, Stephen Darlington <sd...@apache.org>
wrote:

> Ignite doesn't use log4j by default, but it can be configured to do so:
> https://ignite.apache.org/docs/latest/logging#using-log4j2
>
> The output format is also configurable. It's certainly possible to output
> errors to a different file from info and warnings. That configuration is
> not in Ignite but in whichever logger you have enabled. Here are the docs
> for log4j: https://logging.apache.org/log4j/2.x/manual/configuration.html
>
> On Thu, 3 Apr 2025 at 13:08, Charlin S <ch...@hotelhub.com> wrote:
>
>> Hi All,
>> Ignite log not included date only time is writing in log file
>>
>> Sample: [00:05:18,721][WARNING][ignite-update-notifier-timer][GridUpdateNotifier]
>> Pattern is %d{ISO8601}: This will output the date and time in ISO 8601
>> format.
>> And also is possible to write info and warnings in one file and error log
>> in another file.
>>
>> Thanks & Regards,
>> Charlin
>>
>>
>>

Re: Ignite log4j date not included

Posted by Stephen Darlington <sd...@apache.org>.
Ignite doesn't use log4j by default, but it can be configured to do so:
https://ignite.apache.org/docs/latest/logging#using-log4j2

The output format is also configurable. It's certainly possible to output
errors to a different file from info and warnings. That configuration is
not in Ignite but in whichever logger you have enabled. Here are the docs
for log4j: https://logging.apache.org/log4j/2.x/manual/configuration.html

On Thu, 3 Apr 2025 at 13:08, Charlin S <ch...@hotelhub.com> wrote:

> Hi All,
> Ignite log not included date only time is writing in log file
>
> Sample: [00:05:18,721][WARNING][ignite-update-notifier-timer][GridUpdateNotifier]
> Pattern is %d{ISO8601}: This will output the date and time in ISO 8601
> format.
> And also is possible to write info and warnings in one file and error log
> in another file.
>
> Thanks & Regards,
> Charlin
>
>
>