Location of log file in the server - java

I have created logs for my project in a log file. I have provided the location of log file as 'logs/LogFile.log' in the java code. When run on a local server(Tomcat or Websphere), a new folder named 'logs' is created in the classpath of the server and i can find the 'LogFile.log' with logs in it.
Now my project is converted to EAR and it is up in the Dev Server. Where will my log file be created? How can i see those logs?

For a local server, the logs will be appended in the destined log file, which will be in the server installed directory or a remote user created directory.
In case of a remote server, say Unix server, the logs will be generated in the specified location inside the server. We need to login to the unix server via putty or Techtia and can view the logs in the specified locations.

Related

Rundeck config file not found when service starts up

I have installed RD 4.8 CE on a Windows 2019 server + MariaDB. The application is up and I can login with the admin account. Service is Windows integrated.
I'm trying now to allow AD users to login and perform activities. I haven't found much documentation on how to configure RD on Windows. So I'm grabbing from here and there. So far I have done the following:
Created a file called jass-multiauth.conf in server/config/ folder as listed below:
multiauth {
com.dtolabs.rundeck.jetty.jaas.JettyCombinedLdapLoginModule sufficient
debug="true"
contextFactory="com.sun.jndi.ldap.LdapCtxFactory"
providerUrl="ldaps://xxxxxxxxxxx:636"
bindDn="CN=xxxxxx,OU=Service Accounts,OU=Admin Users and Groups,OU=xxx,DC=xxx,DC=xxx,DC=xxx"
bindPassword="x$xx<x>xx"
authenticationMethod="simple"
forceBindingLogin="true"
userBaseDn="OU=Admin Users,OU=Admin Users and Groups,OU=xxx,DC=xxx,DC=xxx,DC=xxx"
userRdnAttribute="sAMAccountName"
userIdAttribute="sAMAccountName"
userPasswordAttribute="unicodePwd"
userObjectClass="user"
roleBaseDn="OU=Groups,OU=Admin Users and Groups,OU=xxxx,DC=xxx,DC=xxx,DC=xxx"
roleNameAttribute="cn"
roleMemberAttribute="member"
roleObjectClass="group"
cacheDurationMillis="300000"
timeoutRead="10000"
reportStatistics="true"
supplementalRoles="user";
org.eclipse.jetty.jaas.spi.PropertyFileLoginModule required
debug="true"
file="E:/rundeck/server/config/realm.properties";
};
when I restart rundeck service the AD users are not recognized and no error at all is displayed in the log. I can however login with the admin account. So to troubleshoot this I added:
java %RDECK_CLI_OPTS% %RDECK_SSL_OPTS% -Drundeck.jaaslogin=true -Dloginmodule.conf.name=jaas-multiauth.conf -Djava.security.auth.login.config=E:\rundeck\server\config\jaas-multiauth.conf -Dloginmodule.name=multiauth -jar rundeck.war --skipinstall -d >> %CURDIR%\var\logs\service.log 2>&1
to the start-rundeck.bat file and in fact when I launch it I see an error which is quite weird:
[2022-12-22T18:58:09,409] ERROR config.GrailsApplicationPostProcessor - Error loading spring/resources.groovy file: java.io.IOException: E:\rundeck\server\config\jaas-multiauth.conf (No such file or directory)
java.lang.SecurityException: java.io.IOException: E:\rundeck\server\config\jaas-multiauth.conf (No such file or directory)
the file is there, path is correct and permission is set as on any other file in same directory. I deleted the file and created it again, but same error.
Also, I have a question: I understand that I should not edit the profile file. Hence, when the problem above is fixed, considering that the rundeck service is Windows integrated, where shall I put the line:
java %RDECK_CLI_OPTS% %RDECK_SSL_OPTS% -Drundeck.jaaslogin=true -Dloginmodule.conf.name=jaas-multiauth.conf -Djava.security.auth.login.config=E:\rundeck\server\config\jaas-multiauth.conf -Dloginmodule.name=multiauth -jar rundeck.war --skipinstall -d >> %CURDIR%\var\logs\service.log 2>&1
to refer the jass-multiauth.conf file?
Your multiauth config file is saved as jass-multiauth.conf but the launcher script is looking for jaas-multiauth.conf (jass =! jaas). That is the reason of "No such file or directory" error. Rename the file as jaas-multiauth.conf and relaunch the Rundeck service.

insert a file into postgres

How do I insert a file that resides in windows in c:\temp\sample.txt
I have tried
insert into lob_file VALUES (5, pg_read_file('c://temp//sample.txt')::BYTEA);
and got
ERROR: could not start file c://temp//sample.txt. No such file or
directory.
Is data base running locally or on a Windows server and you have moved the file to the server. See Docs
The functions shown in Table 9.94 provide native access to files on
the machine hosting the server. Only files within the database cluster
directory and the log_directory can be accessed unless the user is
granted the role pg_read_server_files. Use a relative path for files
in the cluster directory, and a path matching the log_directory
configuration setting for log files.

Change permission for IBM liberty server logs

I have liberty server running on redhat linux for my java batch application. When I liberty start server, logs gets generated with the permission of 640(messages.log). My splunk configuration not able to access this logs and expects 755 permission. what is the configuration change required to change log file permission to 755.
I have tried changing server.env with the below parameter. But didn't work as expected.
WLP_SKIP_UMASK=true
LogFilePermissions=755

Passing dynamic parameter from the url in jnlp file

I have a server that runs on the following url.
http://localhost:8080/
I have JNLP file inside the tomcat folder and hence i can access it by
http://localhost:8080/abc.jnlp
or by the server ip
http://public-ip.org./abc.jnlp
Now the problem is i have a file that can be opened with the jnlp file. I want to pass that file as the parameter. So what i did was:
#RequestMapping(value="showjnlp",method=RequestMethod.GET)
public void showJnlp(){
Process p=RunTime.getRuntime().exec("javaws -open fileName abc.jnlp");
}
Now if i do this the file opens in the server computer where the war file hosted. I want to open the file in the client side. Anyone who knows how to open the file that resides in the server that can be passed as the parameter to the client side or be opened in the client side computer?
If you can link up the jnlp as a web page to the client it will download into the client side machine and run there.

WAR file deployment not connecting to MySQL

I made a dynamic web project in Eclipse IDE and generated a .war file to uploaded it on tomcat localhost for testing using XAMPP server
I deployed the war file in tomcat manager and all the pages are getting displayed properly.
I have made a few connections for connecting to mysql database for insertions. But the deployed does not interacts with the XAMPP phpmyadmin
I checked the username and password for connection string in my java program and made changes in config.inc.php file accordingly in phpmyadmin folder
All the database operations are being executed inside the eclipse environment but when I deploy the war file it is not executing.
Check your XAMPP Apache server configuration..
Go to, config -> phpMyAdmin(config.inc.php) and check this username & password related to Your Java Program.
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = ''
If Mysql has any different password, Change root password to empty.

Categories