Forums Register Login

Add/Put Log4j messages to the Swing JTextField

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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!]
Willie Smits can speak 40 languages. This tiny ad can speak only one:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1401 times.
Similar Threads
String constants
How to disable struts debug/info messages
how to add flash Mx movie to swing?
Multiple log4j configurations in a single classloader ?
Swing App and JWS
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:13:49.