Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Need help defining loggers in log4j properties file.

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am migrating an app to weblogic. It is not my app, I did not write it, and I have never used log4j so I need some help adding the necessary loggers that are keeping the project from migrating successfully.

So let's say here is some of the code from the com.work.apps.mylist.backingbeans source folder. The class is called ActivityHistoryBean.java.


And so forth. Now all the current log4j prop file contains is


I cut a lot out of it to avoid violating any kind of NDAs, but that is the basic idea.

So I need to add the logegrs to the log4j.properties file. Can someone give me an example of what a couple of them would look like using the code I gave above please? It would be extremely helpful (and remember I will need to do this for many other source folders and java class and DEBUG, INFO, WARN, ERROR, FATAL levels).

Please be as verbose as you like, any knowledge I can gain for later use would be great!

Thanks!
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest that the log4j configuration in Weblogic should be exactly the same as what it was in the other unnamed container. What problems arise if you do that?
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am misunderstanding you here. The example I have seen of loggers being defined is as follows:

So I was thinking I would need to do something like:

I don't know, I suppose I should read up on this stuff so I can better articulate what I am trying to get out of this thread. I was just hoping for a quick fix, there have been s many other things on this project I have had to research I just wanted this part to be easy :/

C'est la vie

edit - also, I have no control over the weblogic server setup, I just get to deploy to it
 
Paul Clapham
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was previously an application which was deployed under Application Server X, where X is not Weblogic? And all that's changed is that you need to reconfigure it to run under Weblogic? With the same logging?

Then nothing has changed, application-wise. You might have to change the directories you're logging to, but I don't see why you have to change anything else. You mentioned a "quick fix"... so what needs to be fixed? I find it's better to identify the problems before I start fixing them, and I don't think you have done that.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I may have mis stated something. I went over this app with our resident weblogic migration expert, and he said for logging to work I am going to need to define loggers, and he gave me the example I showed above.
So the problem is not that it will not migrate (as I mistakenly stated), but that logging will no work correctly. So rather than get the ear file deployed and have everything setup and working, then have to go back and fix logging and redo a lot of things, I am trying to get this step done now.

edit - also, when i try to deploy right now I get the following error:



So that led me to believe the loggers were causing that problem, which lead me down this path. I realize now that this would not cause an error like this, but that is why I came here.
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!