Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IBM Worklight - Debug a Worklight Autenticator and/or Login Module

I have a custom Autenticator in a Worklight hybrid project like this

public class MyCustomAuthenticator implements WorkLightAuthenticator{
    private static final Logger logger = Logger.getLogger(MyCustomAuthenticator.class.getName());

    private Map<String, Object> authenticationData = null;

    public void init(Map<String, String> options) throws MissingConfigurationOptionException {
        logger.info("MyCustomAuthenticator initialized");
    }
    ...
}

But I don't see where does Worklight put those logger messages. Am I missing something?

like image 331
user2209957 Avatar asked Mar 04 '26 23:03

user2209957


2 Answers

In your server/conf folder look for the development.logging.properties file and uncomment the following properties:

 com.worklight.level = FINE
 java.util.logging.FileHandler.level = FINE

Then see if the logs appear in your development console.

like image 185
jnortey Avatar answered Mar 06 '26 15:03

jnortey


Perhaps this new instructional video, "Logging and Debugging in Worklight Server", will help you to debug your Java code: http://www.youtube.com/watch?v=KmWBrCilt3Q

The shown in the video assumes you are using Worklight 6.0.

Also see:

  • Worklight 5.0.6.1 - System.out.println() logging from Worklight adapter is not working

    In JavaScript you can use WL.Logger.

    In Java you can use logger.info or logger.warning by importing java.util.logging.Logger.
    logger.info / logger.warning will be printed to the Eclipse Worklight console.

like image 25
Idan Adar Avatar answered Mar 06 '26 13:03

Idan Adar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!