can i copy catalina.log file logs in another file if yes how to configured with spring server? - tomcat9

How to manage catalina.log file, if file is reached a particular size (GB) then copy all logs into another file so i will check logs with a new stable file.
please give me solutions to manage logs file.

Related

Yocto Syslog will not create folder

I have a Yocto build that utilises syslog and logrotate. I have configured my syslog to place any DEBUG messages into a log stored in a hidden folder. This will allow my team to retrieve in field logs without exposing them to the end user.
Syslog logs anything not DEBUG to /var/log as expected. The DEBUG logs go to /home/root/.hidden_logs.
My issue is, if the .hidden_logs folder is deleted, syslog stops logging DEBUG messages. When I run cat /etc/passwd I do not see a syslog user. Is there a way to tell syslog to create /home/root/.hidden_logs if it does not already exist? If not, my plan is to have my application check if the folder exists on boot, if not, create it.

Firebase hosting: The remote web server hosts what may be a publicly accessible .bash_history file

We host our website on firebase. We fail a security check due to the following reason:
The remote web server hosts publicly available files whose contents may be indicative of a typical bash history. Such files may contain sensitive information that should not be disclosed to the public.
The following .bash_history files are available on the remote server : - /.bash_history Note, this file is being flagged because you have set your scan to 'Paranoid'. The contents of the detected file has not been inspected to see if it contains any of the common Linux commands one might expect to see in a typical .bash_history file. - /cgi-bin/.bash_history Note, this file is being flagged because you have set your scan to 'Paranoid'. The contents of the detected file has not been inspected to see if it contains any of the common Linux commands one might expect to see in a typical .bash_history file. - /scripts/.bash_history Note, this file is being flagged because you have set your scan to 'Paranoid'. The contents of the detected file has not been inspected to see if it contains any of the common Linux commands one might expect to see in a typical .bash_history file.
The problem is that we don't have an easy way to get access to the hosting machine and delete these files.
Anybody knows how it can be solved?
If you are using Firebase Hosting, you should check the directory (usually public) that you are uploading via the firebase deploy command. Hosting serves only those files (plus a couple of auto-generated ones under the reserved __/ path for auto-configuration).
If you have a .bash_history, cgi-bin/.bash_history or scripts/.bash_history in that public directory, then it will be uploaded to and served by Hosting. There are no automatically served files with those name.
You can check your public directory, and update the list of files to ignore on the next deploy using the firebase.json file (see this doc). You can also download all the files that Firebase Hosting is serving for you using this script.

LocalDeployer: app working directory

I have an app that creates a file temporarily, does not delete it. I was hopping to see the contents of the file while running.
The app is deployed using the local deployer, does any body knows where would it create the file??
I tried the temp path, and also the working directory where the out and error logs are... nothing, the app does seem to be erroring, that would be on my normal console log.
Running on unix, temp is at /tmp.
thanks
You can control this location via the local deployer property workingDirectoriesRoot and deleteFilesOnExit.
For more information, you can refer this doc:
https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#configuration-deployer
Actually looking at the code of the local deployer, it seems the location it defaults to is the system temp path (System.getProperty(“java.io.tmpdir”)) and adds the stream id, plus the app id, etc. It is the same folder where the console and error streams write to.
thanks!

Talend: Using tfilelist to access files from a shared network path

I have a Talend job that searches a directory and then uploads it to our database.
It's something like this: dbconnection>twaitforfile>tfilelist>fileschema>tmap>db
I have a subjobok that then commits the data into the table iterates through the directory and movies files to another folder.
Recently I was instructed to change the directory to a shared network path using the same components as before (I originally thought of changing components to tftpfilelist, etc.)
My question being how to direct it to the shared network path. I was able to get it to go through using double \ but it won't read any of the new files arriving.
Thanks!
I suppose if you use tWaitForFile on the local filesystem Talend/Java will hook somehow into the folder and get a message if a new file is being put into it.
Now, since you are on a network drive first of all this is out of reach of the component. Second, the OS behind the network drive could be different.
I understand your job is running all the time, listening. You could change the behaviour to putting a tLoop first which would check the file system for new files and then proceed. There must be some delta check in how the new files get recognized.

Restore full external ESENT backup

I've wrote the code that creates full backups of my ESENT database, using JetBeginExternalBackup API.
Following the MSDN guidelines, I backed up every file returned by JetGetAttachInfo and JetGetLogInfo.
I've made the backup, erased old database, and copied the backup data to the database folder.
The DB engine was unable to start, the JetInit error code is "JET_errMissingLogFile".
I've checked the backup, it only contains the database file, and "<inst>XXXXX.log" log files. It lacks the current log file (I'm using circular logging, BTW).
Is there any way to restore such backup?
I don't want to use JetExternalRestore API because it's too complex: I don't need to restore to another location, I don't understand why there're 3 input folders not 2, and I don't know the values to supply in genLow and genHigh arguments.
I do need external backups: the ESENT database is used by ASP.NET on a remote server, and I'm backing it up over the Internet.
Or, maybe there's a way to retrieve the name of the current log file, and I should just add it to the backup?
Thanks in advance!
P.S. I've got no permissions to span processes on my web server, so using eseutil.exe is not an option.
Unpack all backed up files to a single folder.
Take the name of your main database file. Replace extension to .pat. Create zero-length file with that name, e.g. database.pat.
After this simple step, call JetRestoreInstance API, it will restore the backup from that folder.