Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Log4j: Warn no appenders could be found for logger (com.mcreations.usb.windows.JavaxUsb)

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was using javax.usb api for accessing usb port from my java applications.

I have set jsr80.jar, jsr80_ri.jar and jsr80_windows.jar, log4j.jar, log4j.properties and javax.usb.properties to the classpath...

My java class compiled properly..

class name : TestUsb

import javax.usb.*;
import javax.usb.UsbServices;

But when i tried to run the class following runtime error occured
Log4j: Warn no appenders could be found for logger (com.mcreations.usb.windows.JavaxUsb)
Log4j:Warn please initialize the log4j system properly

Please any one can help.
Before posting this topic i have done everything that i could.

 
Sheriff
Posts: 21972
106
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you add appenders to your logger(s), either through code or through the configuration file? Because if you don't, you get this message.
 
pradeep dewda
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rob Prime wrote:Did you add appenders to your logger(s), either through code or through the configuration file? Because if you don't, you get this message.



I didn't understand what you are trying to explain. Please could you describe in detail?
Although below is the log4j.properties file. Is following configuration is right?

# For the general syntax of property based configuration =
files see the
# documenation of org.apache.log4j.PropertyConfigurator.
log4j.rootLogger=3Derror, stdout, file
#log4j.rootLogger=3Ddebug, stdout, file

# this one would log to file usb.log (which will be backed up to =
usb.log.1)
#log4j.rootLogger=3Ddebug, stdout, file

log4j.appender.stdout=3Dorg.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=3Dorg.apache.log4j.PatternLayout

# Pattern to output the caller's log level, thread, class name and =
message
log4j.appender.stdout.layout.ConversionPattern=3D[%5p] %c{1} - %m%n

# This one shows the method names (slows down logging, so use only, if =
necessary).
# log4j.appender.stdout.layout.ConversionPattern=3D%d [%5p] %c{1}.%M - =
%m%n

log4j.appender.file=3Dorg.apache.log4j.RollingFileAppender
log4j.appender.file.File=3Dusb.log

log4j.appender.file.MaxFileSize=3D4MB
# Keep one backup file
log4j.appender.file.MaxBackupIndex=3D1

log4j.appender.file.layout=3Dorg.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=3D[%5p] %c{1} - %m%n

# This one shows the method names (slows down logging, so use only, if =
necessary).
#log4j.appender.file.layout.ConversionPattern=3D%d [%5p] %c{1}.%M - %m%n

# disable DEBUG for some classes
#log4j.logger.com.mcreations.usb.windows.JavaxUsb=3Dwarn

Well i am developing a e-attendance application in which i have to use usb port to connect a fingerprint reader and access that device with java application.
Rob would i explain more or is it enough?
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic