I want each service to able to direct its log4j logging to separate log files. I've tried a custom log4j.properties file in the root of the service assembly jar, as well as a custom META-INF/services/org.apache.commons.log.LogFactory (on the theory that AMX may be using Commons Logging rather than direct log4j), but neither sends my service's logging where I've configured.
Is there any mechanism to accomplish this?
Why did you do that :-)?
You can use the common logging provision that AMX offers. All you need to do is to make sure each java component goes into a different service unit and then at deploy time you should configure the file appender for each service unit!
Simpler than it sounds, really.
All I can find is Container-level logging or the Logging Configurations under the individual Assembly's settings, and the latter seems to simply control the location of the XML log file which contains all the internal messages, not my application-written, plain-text messages. My messages are only appearing in the stdOut.log file, which I gather is because the whole Java Container is set to log to the Console? (I'd also like to control the logging Pattern if possible, not just the file name.)
So I'll need a little more assistance to find whatever location you're describing. Thanks.
At the outset, this is the documentation section that may benefit:
In the guide under: amx\2.X\\doc\amf\pdf\tib_amx_administration, there is a pdf. In that PDF look at Chapter 10. There is a section on "Working with Logging Configurations".
Now in that section you will learn how to enable Service Unit logging.
On the other hand, at design time ensure that you have one component per service unit to achieve what you are trying to do. Look at: \amx\2.X\doc\amf\pdf\tib_amx_composite_editor_users_guide and under that there is a PDF. In that PDF look at Chapter 6 on how to configure Service Units in a Service Assembly.
HTH,
Setu
Thanks for the pointers. Sounds like I need to edit bootStrap.xml. Looking at that, I can see that somebody on my team has done that in the past, and their change explains why my logging is going to stdOut.log no matter what I change in the Administrative UI. (I joined this project after it changed ownership and several team members left, so I'm having to learn things from the beginning.)
(If I add File logging to either the Service Assembly or the appropriate Service Unit, that simply sends additional XML messages to the specified log files, which is not what I need.)
Make sure all the hand edits are reset so that the redirection and the appenders that the software allows you to setup work fine.
Setu