What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-18 09:50:08
Request Logging
# logging_example.py import logging # Create a custom logger logger = logging.getLogger(__name__) # Create handlers c_handler = logging.StreamHandler() f_handler = logging.FileHandler('file.log') c_handler.setLevel(logging.WARNING) f_handler.setLevel(l... Add solution -
Other 2021-11-07 16:05:21
logging request
# logging_example.py import logging # Create a custom logger logger = logging.getLogger(__name__) # Create handlers c_handler = logging.StreamHandler() f_handler = logging.FileHandler('file.log') c_handler.setLevel(logging.WARNING) f_handler.setLevel(l... Add solution -
Java 2021-10-23 10:11:07
spring security auto login after register
public void authWithHttpServletRequest(HttpServletRequest request, String username, String password) { try { request.login(username, password); } catch (ServletException e) { LOGGER.error("Error while login ", e); ... Add solution -
Java 2021-10-20 21:49:06
Read File from Sprinboot
Using ResourceUtil @Override public void run(String... args) throws Exception { File file = ResourceUtils.getFile("classpath:data.txt"); if(file.exists()) { byte[] fileData = Files.readAllBytes(file.toPath()); String fileContent = ne... Add solution -
Java 2021-10-08 13:56:09
java how to call getReader twice
public class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper { private static final Logger logger = Logger.getLogger(CustomHttpServletRequestWrapper.class); private final String body; public CustomHttpServletRequestWrapper(HttpServletR... Add solution -
Other 2021-09-30 11:46:03
print loggibng.info to file
import logging.config if __name__ == '__main__': # Configure the logger # loggerConfigFileName: The name and path of your configuration file logging.config.fileConfig(path.normpath(loggerConfigFileName)) # Create the logger # Admin_Cl... Add solution