Specify FFDC filename - open-liberty

Anybody know of a way to specify which filename to use for ffdc logs and summary?
I have tried to specify the environment variable com.ibm.ffdc.log with no effect. I am using OpenLiberty 19.
Thanks.

This variable is used in WebSphere traditional (8.5.5/9.0).
OpenLiberty logging configuration is described here - https://openliberty.io/docs/21.0.0.6/log-trace-configuration.html
In Liberty you can change the output and log folder locations.
You can also combine messages from various sources via properties or env variables. For example:
WLP_LOGGING_MESSAGE_FORMAT=json
WLP_LOGGING_MESSAGE_SOURCE=message,trace,accessLog,ffdc,audit
Any reasons why you need to change ffdc filename/location?

Related

Stop the creation of FDC file in IBM MQ or create it at desired location

I have an application which creates xmsffdc*.FDC ( replace * by some number ) . Not i want to stop creation of this FDC file as due to an issue there can be thousands of it generated which would fill space and create clean up issues too.
My preferred way is to create this FDC file to a desired location such as
on a different mount ( so that disk where process collects data do not get impacted ) or
To stop the creation of FDC file using some environment file.
What are the ways to accomplish 1 and 2 ? Note i am using IBM MQ7.5 and 8.0 client version
As it says in IBM Knowledge Center: FFDC configuration for XMS .NET applications
By default, all FFDC files are written to the current directory.
However, if required, you can specify a different directory by
changing ffdcDirectory in the Trace section of the application
configuration file. In the following example, all trace files are
logged to the directory c:\client\ffdc:.
<IBM.XMS>
<Trace ffdc=true ffdcDirectory="c:\client\ffdc"/>
</IBM.XMS>
You can disable them by setting FFDC to false in
the Trace section of the application configuration file.

jvm.options IBM LIBERTY

I search a lot on the web, almost all links says define JVM custom variables in jvm.options also placed it on ${server.config.dir}/jvm.options.For example I added a variable called -DAPP_ENV=PROD. But this is getting as NULL after server startup.
Any idea?
It looks like you want to define an environment variable, so you have two options.
1. Use an Environment variable
In this case, you can define an environment variable (like $PATH) and load it in your app. Note this is not a JVM argument, and it will be set in the bin/server shell command used to start the server.
In the file:${server.config.dir}/server.env
Add the following line: APP_ENV=PROD
Access the value with:
System.getenv("APP_ENV"); -> PROD
2. Use a System property
This is what you are trying to do, so I am not sure why it doesn't work for you, but here's how:
In the file:${server.config.dir}/jvm.options
Add the following line: -DAPP_ENV=PROD
Access the value with:
System.getProperty("APP_ENV"); -> PROD
Note that in both cases these values are set at server start-up, and they are not changed dynamically (most Liberty configuration is dynamic). The JVM options and environment are sourced and set during the start script so a restart is required if you want to change either one.
My personal recommendation is go to the server.env route - its more generic and (to me) feels more appropriate since you are trying to influence the execution environment of the process, rather than defining behaviors or configuration of the JVM.

What exactly setenv.sh is used for in Tomcat?

I searched a lot but couldn't find any useful information about this:
What exactly setenv.sh is used for in Tomcat ?
Let's say we have a REST API (built with Java EE or Spring) which uses some parameters/variables like AWS Credentials, Database Credentials etc.
Does it make sense to parametrize the application with environment variables for these things I mentioned above and put their values to env vars on setenv.sh for each Tomcat instance in case we use more than one instance and with different parameters/variables ?
Or setenv.sh isn't for things like that ?
Thanks in advance
I've only ever seen it used for specifying CATALINA_OPTS, but I noticed that the RUNNING.txt file mentions using it to set JRE_HOME and JAVA_HOME.
RUNNING.txt also states under Advanced Configuration - Multiple Tomcat Instances:
In many circumstances, it is desirable to have a single copy of a
Tomcat binary distribution shared among multiple users on the same
server. To make this possible, you can set the CATALINA_BASE
environment variable to the directory that contains the files for your
'personal' Tomcat instance.
So I guess the answer is that a setenv file can be created for each app and can probably can be used to store credentials, but I don't think that it's commonly used for that purpose.
~/Programs/apache-tomcat-9.0.7/bin/setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -DENV_TARGET=prod -DMy_Env_Var1=Whatever -DMy_Env_Var2=CapitalOneIsTheBest"
So everything in between "" above in setenv.sh gets set as environmental variables for your applications in Tomcat. To retrieve/use those environmental variables, use this in your Java (Spring) applications:
Ex1) String myWhatever = java.lang.System.getProperties().getProperty("My_Env_Var1");
Ex2) String env= System.getProperties().getProperty("My_Env_Var2");
To change the environmental variable (for example when you are writing unit tests), do this:
System.setProperty("My_Env_Var1", "newEnv");

Fetch JMS configurations and property values for each individual servers in WAS using wsadmin script

I need to fetch JMS configurations and property values for each individual servers of WAS using wsadmin script. Is there any IBM standard jython or jacl script is there to fetch these values ? If not, can somebody guide me how to procceed.
You can export your server configuration via wsadmin command (this will export all server configuration):
AdminTask.extractConfigProperties('[-propertiesFileName ConfigProperties_server1.props -configData Server=server1]')
To extract properties related to MQ JMS resources you could provide subtype in the script:
AdminTask.extractConfigProperties('[-propertiesFileName mq.props -configData Server=server1 -filterMechanism SELECTED_SUBTYPES -selectedSubTypes [MQConnectionFactory MQQueue]]')
You could modify required properties and then import them to different server/environment.
See more details about different types and usage here Extracting properties files using wsadmin scripting.
AdminTask and AdminConfig are good tools for this.
You can use the jython line "print AdminTask.help('-commands')" to print all the commands that your configuration supports.
As for AdminConfig you will need a bit of knowledge on how was xml configurations are stored.
See for more info: http://www-01.ibm.com/support/knowledgecenter/?lang=en

Warning in Jmeter log

im performancetesting a site with Jmeter that is on an internal environment. However we also have a company proxy which i have configured in the HTTP default request manager in Jmeter.
Now everything works fine, however i keep seeing these WARNINGS in the jmeter.log when im tailing at runtime.
Everytime a thread starts up i see:
2014/02/07 15:35:46 WARN - org.apache.http.client.protocol.RequestProxyAuthentication: NEGOTIATE authentication error: Invalid name provided (Mechanism level: Could not load configuration file C:\WINDOWS\krb5.ini (Het systeem kan het opgegeven bestand niet vinden))
2014/02/07 15:35:48 INFO - jmeter.threads.JMeterThread: Thread started: Mythread 1-4
Does anyone know what this means, and if it is going to cause any problems. Ive tried setting the proxy credentials in like every possible place but it doesnt seem to matter.
Regards,
Johan
You can ignore these messages unless you are testing application which uses Kerberos authentication. If you want it to go away - read below for explanation of what's happening and how to get rid of it.
The warning is for missing Kerberos configuration file in the default location. If you need to test application which assumes Kerberos login, you need to properly configure krb5.conf and jaas.conf files in /bin folder of your JMeter installation. If you're changing application module name in jaas.conf make sure that the same value is present in jmeter.properties or user.properties file as kerberos_jaas_application property. You can also specify the property during JMeter startup as -J parameter, i.e.
jmeter -Jkerberos_jaas_application=testapp -n -t myscript.jmx -l myscript.jtl
and make sure that following two system properties are set:
-Djava.security.krb5.conf=krb5.conf
-Djava.security.auth.login.config=jaas.conf
the paths given are relative to JMeter home folder, you might want to use full paths. See Apache JMeter Properties Customization Guide for more details on how to play with JMeter properties.
Also make sure that you set "Implementation" dropdown to HTTPClient4 in HTTP Request Defaults (or for each HTTP Sampler)
Hope it makes sense

Resources