Go to Post I might be a nerd, but I am definitely a pi freak! - Courtneyb1023 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 01-31-2016, 10:00 AM
java4first java4first is offline
(Java) Programming Mentor
AKA: Stu
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 2011
Location: Goffstown, NH
Posts: 56
java4first is an unknown quantity at this point
Help w/ log4j on roboRIO

Hi -

I wanted to move to a better logging mechanism than System.out.println, and decided to go with log4j. But I am having some problems getting it running ... I see a couple of posts about it here, but nothing has helped with making it work on this year's robot.

I tried to go with the 'new' version 2, but there appear to be dependencies that I don't want to deal with - and previous experience with the older version 1 says it will work for our needs.

I modified the userLibs entry in build.properties to get the third party libraries incorporated, and that seems to work - if I untar the FRCUserProgram.jar after a build, there are a bunch of classes in there, which I assume is a correct repackaging of the log4j-1.2.17.jar.

The problem is the configuration file - log4j.properties. I can't figure out how to get it into the jar file so it shows up for use. I tried looking through the hierarchy of build.xml files for Ant in the WPILib stuff - but don't know enough about Ant to find out how.

So I decided to just copy it over to the lvuser home directory, since that seems to be the default classpath for the execution of the script that actually runs the built jar file. But I get log4j warnings about the initialization process; including some exceptions about a Java class not found for "java/beans/IntrospectionException" - which I assume is because the version of Java we run on the roboRIO is missing what a 'normal' SDK has.

At this point my log4j.properties is pretty basic - just a simple console appender for output. So I'm assuming that isn't the problem.

If I use the BasicConfigurator, I still get the warning and the NoClassDefFoundException, but it sort of runs - as I get my formatted log messages to the NetConsole ... I just can't control the output.

If someone who has gotten this working could give me some help, I would greatly appreciate it!

Thanks in advance!
Stu
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:28 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi