Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example logging with Kotlin
// ...elided package and imports... //
import com.example.profileservice.logging.logger
@RestController
class ProfileController @Autowired constructor(
val profileRepository: ProfileRepository
) {
// This is how you create a logger
val log = logger()
@RequestMapping("/profiles", method = arrayOf(RequestMethod.GET))
fun getProfileByEmail(
@RequestParam(value = "email") email: String
): DeferredResult<ResponseEntity<Profile>> {
// Info level logging operation
log.info("Fetching profile for email={}", email)
// ...elided controller code... //
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.