Disable file logging in spring boot - spring-boot

the spring-boot application automatically creates spring.log file under temp folder of user_path/AppData/Local/Temp/spring.log
I have a use case where I don't want any of my logs to be written in to log file, whereas I need them to be printed in console output.
How do I achieve this?

Remove logging properties
If you want to write log files in addition to the console output, you need to set a logging.file or logging.path property (for example, in your application.properties).
logging.path:
Writes spring.log to the specified directory. Names can be an exact location or relative to the current directory.
logging.file:
Writes to the specified log file. Names can be an exact location or relative to the current directory.

Related

Giving absolute directory path for logfile in Maven's simplelogger.properties

In Maven's ${maven.home}/conf/logging/simplelogger.properties file, I want to change the value of property org.slf4j.simpleLogger.logFile from System.out to a Directory with an absolute path like C:\Users\RaghavGupta\Desktop\Logs\abc.log. When I provide the latter value it always create a file at current directory from where I am executing the mvn command with filename UsersRaghavGuptaDownloadsDesktopLogsabc.log which I don't want.
How can we provide a absolute path so that log file gets created there from simplelogger.properties file?

vim /etc/ansbile/ansible.cfg opens an empty file instead of the default ansible.cfg

While following a training, I ran vim /etc/ansbile/ansible.cfg on my Mac.
In the training video, this command loads a default ansible configuration file while on my Mac it came back with a blank page.
How can I get a default config file to start editing it?
There is no default ansible configuration file by default. In other words, ansible does not create any system wide configuration file at install and will use default values for all parameters if run without any existing configuration file (system wide, user home, project level...)
Since you are trying to edit a file which does not exist, vim starts with an empty buffer to create a new file.
You can easily create an ansible.cfg file containing commented out default values of all known parameters and store it wherever you like with the following command:
ansible-config init --disabled -f ini > /tmp/ansible.cfg

Why doesn't glog support the setting of stdout?

By default, all log statements write to files in a temporary
directory. This package provides several flags that modify this
behavior. As a result, flag.Parse must be called before any logging is
done.
-logtostderr=false Logs are written to standard error instead of to files.
-alsologtostderr=false Logs are written to standard error as well as to files.
-stderrthreshold=ERROR Log events at or above this severity are logged to standard error as well as to files.
-log_dir="" Log files will be written to this directory instead of the default temporary directory.
As we can see in the documentation, all parameter settings are for stderr, no stdout. Why?
Why not expose stdout parameters(e.g., logtostdout,alsologtostdout,stdoutthreshold) to the user?
In addition, I think users should expect alsologtoSTDOUT=true as the default behavior in logging(i.e., logs are written to standard out as well as to files)

how to access a file placed outside karaf in karaf bundle

i have a file check placed at /home/abc. I want to read this file from a bundle running in karaf.
Location of that file is fixed. So, i can hardcode that. But i am not able to find a way for it.
one way- you need to copy the file into the /etc/ folder.
second way- you need to define JAVA_OPTS=-DprojectName="/directorypath/filename" into the /bin/karaf.bat or .sh file and restart the karaf.
write the code like this you are reading the file from
String s= System.getPropety("projectName/filename");
File f = new File(s);

Jmeter CSV data config doesn't identify the userid and password in csv file

I have created a CSV file and placed in /bin directory and added csv data config file with paramaters UID and PWD but when I run the test it does not show the user id and password. Despite, in the csv file it shows as txtlogin=<EOF>&txtpassword=<EOF>.
Why isn't it picking the given userids and password?
You should place your csv file where you saved your test script file. Normally test script can be saved as with jmx extension and placed your csv file in the same directory of it.
Make sure you have put your CSV file in parallel of your saved result file, I have solved my problem with this while getting EOF error. :)
See this how to read and refer variables from csv.
And look into %JMETER_HOME%/bin/jmeter.log if something goes wrong.
Make sure you have the fully qualified path of the CSV file to ensure JMeter can find it.
I was getting in my variable values when I had ./mycsvfile.csv as the path. I took the ./ off the front and it started working. My csv file is in the same directory as my .jmx test script file.
I just ran into the same issues. It seems to be a bug.
Don't name your .csv file "user.csv" or "users.csv". They seem to be reserved names.
I changed the name of the file and then it worked.

Resources