The course is part of this learning path
In this course, we will learn the concepts of microservice and spring framework with a focus on Cloud.
Learning Objectives
- Learn about Cloud
Intended Audience
- Beginner Java developers
- Java developers interested in learning how to Build and Deploy RESTful Web Services
- Java Developers who want to develop web applications using the Spring framework
- Java Developers who want to develop web applications with microservices
- Java Developers who wish to develop Spring Boot Microservices with Spring Cloud
Prerequisites
- Basic Java knowledge
Logging. Hello dear friends. In this lesson, we will talk about logging. In Open Liberty, the default logging level is audit. If you print a log with a degree of info, it is not to be seen on the console. Let's look at it: Open system info project, open system resource class, define a logger. Let's try to print logging get username method. Save the changes. Let's do a log in operation. User can be admin or regular, that's not a big deal. Logged in. Let's check the console. As you see here, there's no log about our operation. To show we need to change our log level, open the server.xml file. Find the logging tag or write a new one if it doesn't exist. Write console, log level key and info as value. Save the changes. Now try again to log in. Check the console. As you see, logging info has been printed. There are different console log level parameters. There are info, audit, warning, error, and off. You can change console log format too. The default format is DEV. Let's change it to JSON. As you can see, log info has started to print in JSON format.
One last thing I want to mention is access logs. Let's try to print the access log. To do this, we need to define it as a console source. And we can add an access logging tag nested HTTP and point tag. Through access logging tag, we define a logging format and log file place. Save it. Let's log in again. As you see here, access log info is printed on the console. All right, dear friends. That's it for now. I'll see you in the next lesson.
OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.