Home Forums Kamanja Forums Features & Releases initializing the log4j system properly

This topic contains 6 replies, has 4 voices, and was last updated by  Archived_User7 1 year, 6 months ago.

  • Author
    Posts
  • #13432 Reply

    Archived_User7
    Participant

    Hi,

    When I run the following command:

    $ kamanja upload compile config
    
    Using default configuration /usr/local/Cellar/kamanja/1.2/config/MetadataAPIConfig.properties
    
     WARN [main] - DATABASE_SCHEMA remains unset
    
     WARN [main] - DATABASE_LOCATION remains unset
    
     WARN [main] - DATABASE_HOST remains unset
    
     WARN [main] - ADAPTER_SPECIFIC_CONFIG remains unset
    
     WARN [main] - SSL_PASSWD remains unset
    
     WARN [main] - AUDIT_PARMS remains unset
    
     WARN [main] - DATABASE remains unset
    
    log4j:WARN No appenders could be found for logger (org.apache.curator.framework.imps.CuratorFrameworkImpl).
    
    log4j:WARN Please initialize the log4j system properly.
    
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
    
    Pick a Config Definition file(s) from below choices
    
    [1]/usr/local/Cellar/kamanja/1.2/config/ClusterConfig.json
    
    [2]/usr/local/Cellar/kamanja/1.2/config/COPDRiskAssessmentCompileCfg.json
    
    [3]/usr/local/Cellar/kamanja/1.2/config/LBCompileCfg_Finance.json
    
    [4]/usr/local/Cellar/kamanja/1.2/config/Model_Config_HelloWorld.json
    
    [5]/usr/local/Cellar/kamanja/1.2/config/SubscriberUsageAlertCompileCfg_Telecom.json
    
    Enter your choice(If more than 1 choice, please use commas to seperate them): 
    
    What do I do about:
    
    log4j:WARN No appenders could be found for logger (org.apache.curator.framework.imps.CuratorFrameworkImpl).
    
    log4j:WARN Please initialize the log4j system properly.
    
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
    
    ?

    How do I initialize the log4j system properly?

    I wasn’t getting this warning when I used Kamanja v1.1.

    thanks,

    alison

  • #13433 Reply

    Archived_User1
    Participant

    Hey Alison,

    That message is a result of our change from log4j to log4j2. That error is actually coming from external components that we rely on. I believe something is happening with the CuratorFramework’s logging. Since we aren’t providing a configuration file it seems it is failing to initialize its logger. it doesn’t really hurt anything but I’ll take a look to see if there’s a change that can be made to quell that message.

    -William

  • #13434 Reply

    Archived_User7
    Participant

    Then when I run:

    $ bash PushSampleDataToKafka_HelloWorld.sh 
    ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
    log4j:WARN No appenders could be found for logger (kafka.utils.VerifiableProperties).
    log4j:WARN Please initialize the log4j system properly.
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    Tid: 0, Time:  12971154ms, Lines:      51, Read:           2755, Sent:           2755, Last, file:/usr/local/Cellar/kamanja/1.2/input/SampleApplications/data/Input_Data_HelloWorld.csv.gz
    00. File:/usr/local/Cellar/kamanja/1.2/input/SampleApplications/data/Input_Data_HelloWorld.csv.gz ElapsedTime:50.00ms
    Done. ElapsedTime:308.83ms

    So, I’m definitely missing some steps regarding log4j. Can someone help?
    thanks,
    alison

  • #13435 Reply

    Archived_User1
    Participant

    In the case of the script, and SimpleKafkaProducer, there is neither a log4j2 file being included in the fat jar (there isn’t one in source for this project) nor is the script indicating a log4j2 file to use. We can simply update the script and add a basic log4j2 file in source.

  • #13436 Reply

    Archived_User79
    Participant

    I always prefer to use external file instead of putting any log4j properties/xml file in project resources

  • #13437 Reply

    Archived_User13
    Participant

    Let’s stick with one policy across all components – external files should be preferred as they can be changed dynamically.

  • #13438 Reply

    Archived_User7
    Participant

    Please let me know the steps to set up an external file.

Reply To: initializing the log4j system properly
Your information: