This is potentially one of the best posts that I’ve done in a while… Well, perhaps it might be one of the most helpful ones in a while. But, I’d best get off my soap box and get into the nitty gritty of the post.
It’s a common situation that a UBE goes into Error sometimes and works the rest of the time… So, you need debug… Your choices are limited for enabling logging, as it’s pretty global on your enterprise server and will be enabled for all UBE’s and all processes that start after you’ve enabled the setting in the JDE.INI file.
I had this conundrum at a client recently and decided to try and enable logging in an OSA. If I could enable logging with an OSA, I could map this to any UBE that I needed to enable logging for. Therefore, no package builds, no deploys, no global logging enabled – just logging for the UBE’s that I want to log WHEN I want to log them.
So now you can configure what logging is enabled for a UBE based on :
- version
- environment
- machine
Too good to be true, no – it actually worked! The best thing is, I’m going to give you all of the source code as well. All 1 line of it!
EXTERNC APIEXPORT void CDECL myriadEnableLogging(POSA_REPORT_INFO pOSAReportInfo,
POSA_LINK_INFO pOSALinkInfo,
unsigned long ulNumberOfLinks)
{
//jdeDebugInit();
changeLogSettingsNoINI(_J("Output"), 1);
}
So you can map this to the UBE that you want logging via the OSA application.
You need to compile the code above into a DLL (in my case called myOSA) and plonk this in the enterprise server bin32 dir.
Then create the OSA definition P986168 for enableLogging
The first button above and then add
Then map your UBE’s that you want logging on for (the second button)
The second button
So in this example I’m enabling logging for all users that run R42565 in JDV910.
If you want a windows DLL prebuilt with this code, let me know and I’ll probably be nice and send it to you.