According to 
https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/helpers/LogLog.html
 
<https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/helpers/LogLog.html>
 that class is used to log stuff internal to Log4j. Log4j 2 uses the 
StatusLogger for this. StatusLogger uses the Log4j API but has limited output 
control. You can find documentation on it at 
http://logging.apache.org/log4j/2.x/manual/configuration.html#StatusMessages 
<http://logging.apache.org/log4j/2.x/manual/configuration.html#StatusMessages>. 
However, this is intended to only be used by Appenders, Filters or other Log4j 
plugins you create.

If you want to log exceptions you should just use 

        logger.error(“The error thrown during the process: “, ex);

Debug and warning messages should be:

        logger.debug(“Listening on port {}”, port);
        logger.warn(“Could not find class - {}”, className);

After looking at FileWatchDog, Log4j 2 doesn’t have a class that you could use 
to monitor any arbitrary file. It does have a FileWatcher interface that is 
used to monitor the configuration files. You can register a 
ConfigurationListener that will have its onChange method called when the 
configuration is changed.

Ralph

> On Dec 19, 2017, at 4:29 PM, Praveen Kumar Gunasekaran 
> <praveenkumarg...@gmail.com> wrote:
> 
> Ralph,
> 
> Sure. One of the examples that i can give as of now is for LogLog class.
> 
> We use LogLog class for exception handling. For any issues thrown during
> the logic, we catch the exception and throw the error using LogLog like
> below,
> 
>                    LogLog.error( "The error thrown during the process: ."
> );
> 
> We also use for handling debug and warning information which will help the
> developers,
> 
>                    LogLog.debug("Listening on port " + port);
>                    LogLog.warn("Could not find class - ");
> 
> 
> Thanks,
> Praveen Kumar
> 
> On Wed, Dec 20, 2017 at 2:43 AM, Ralph Goers <ralph.go...@dslextreme.com>
> wrote:
> 
>> I will give the same answer I gave to another user just last week.
>> 
>> You are better off telling us what you are trying to achieve then asking
>> questions like below. Log4j 2 works very differently than Log4j 1 and has
>> more capabilities built in. It is better to take advantage of that then
>> simply trying to convert code line by line or function by function.
>> 
>> Ralph
>> 
>>> On Dec 19, 2017, at 2:09 PM, Praveen Kumar Gunasekaran <
>> praveenkumarg...@gmail.com> wrote:
>>> 
>>> Hi,
>>> 
>>> I am working on migrating our application from Log4J 1.2.15 version to
>>> latest Log4J 2.10 version. I did look into the documentation for
>> migration
>>> 
>>> https://logging.apache.org/log4j/2.x/manual/migration.html
>>> 
>>> The above link helped me in some of the issues but still i am not able to
>>> find the replacement for class files like,
>>> 
>>> org.apache.log4j.helpers.LogLog
>>> org.apache.log4j.helpers.FileWatchdog
>>> 
>>> and few more.
>>> 
>>> I would like to know if there is any mapping documentation available for
>>> 1.x classes to 2.x classes? Please do the needful.
>>> 
>>> Thanks,
>>> Praveen Kumar
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
>> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>> 
>> 

Reply via email to