Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Add/Put Log4j messages to the Swing JTextField  RSS feed

 
brijesh sharma
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
This is the first time I am posting any messages to any forums . Hope someone may reply soon .

My Problem is how to add log4j messages to the Swing Jtextfield. How to use LF5Appender to add the messages to swing component. I have tried many things but It is not working .
Like one of the vague trial was to add the messages to the file and then read from the file but that would read old messages not the new ones which will be written . plus lots of other problems (null vlaues etc.)
Is there any way where I can directly guide my Logger messages to the swing JTextField or any other component without going to any other file etc.

Thanks and Regards
Brijesh(India)


BELATED MERRY XMAS TO ALL
 
clio katz
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't know if you have run the examples included in the dist, but the bulk of the lf5 stuff is for logging to the lf5 gui console.

i don't think any of the lf5 packages is tailored to directly talk to misc swing component, but they do give you alternatives: you can pick up log messages from a socket, or from a database.

jswat is a good example - it can be configured for debugging using socket ipc

another option would be to write a wrapper to "tee" log messages to your app and also to log4j. [if you're familiar with the unix tee cmd...]

in unix, you have plenty of ipc options. but i must comment that this is potentially a very io-intensive task for a swing app, especially if you plan to handle it in a jtextfield - i think you'll prefer lf5 console once the swing q gets bottlenecked but

hth
[and happy holidays!]
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!