{"id":17350429,"url":"https://github.com/avidee007/custom-logger-advice","last_synced_at":"2026-02-03T04:33:42.975Z","repository":{"id":257407595,"uuid":"858158956","full_name":"avidee007/custom-logger-advice","owner":"avidee007","description":"Custom annotation to separate logging concerns from business layer. Works with spring AOP to perform advice to custom annotation to do console and database logging.","archived":false,"fork":false,"pushed_at":"2024-09-16T13:01:05.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-16T18:34:03.672Z","etag":null,"topics":["annotations","generics-in-java","rest-api","spring-aop","spring-boot","spring-data-jpa"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avidee007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-16T12:15:27.000Z","updated_at":"2024-09-16T13:05:32.000Z","dependencies_parsed_at":"2024-09-16T15:07:15.203Z","dependency_job_id":"42f5e855-4bd2-459b-a93b-bae1cc483d65","html_url":"https://github.com/avidee007/custom-logger-advice","commit_stats":null,"previous_names":["avidee007/custom-logger-advice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidee007%2Fcustom-logger-advice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidee007%2Fcustom-logger-advice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidee007%2Fcustom-logger-advice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avidee007%2Fcustom-logger-advice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avidee007","download_url":"https://codeload.github.com/avidee007/custom-logger-advice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228415504,"owners_count":17916174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotations","generics-in-java","rest-api","spring-aop","spring-boot","spring-data-jpa"],"created_at":"2024-10-15T17:06:51.607Z","updated_at":"2026-02-03T04:33:42.916Z","avatar_url":"https://github.com/avidee007.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Logger Advice Service\n\n**Problem**\n\nSometimes we need to push request details in a database for tracking purposes,\nand this can be an overhead to API performance.\nThis requires additional handling of database persistence logic which can slow and\ncause issues to overall API performance.\n\n**Solution**\n\n* Custom annotation `@LoggerAdvice` to separate logging concern from service/business layer code.\n\n* This annotation has **logToDb** flag which can decide whether logs push logs to database table.\n\n* This annotation uses spring AOP, to do logging as advice to `@LoggerAdvice` annotation.\n\n* When logToDb is set to true it persists the request entity asynchronously to do persistence in\n  separate thread to avoid any API performance issues.\n\n**How to use @LoggerAdvice:**\n\nThis is method level annotation can be applied to any method to use it.\n\n`@LoggerAdvice\n public void methodWithOutDbLogging() {\n   // actual method code logic\n}`\n\n`@LoggerAdvice(logToDb = true)\n public void methodWithDbLogging() {\n   // actual method code logic\n}`\n\n**Custom Logger Advice Service was built with below components**\n\n* spring-web: To build RESTFul api.\n* spring-aop: To build logger advice for @LoggerAdvice annotation\n* spring-data-jpa: To do persistence of entities in database.\n* postreSQL: Database\n* Junit and Mockito: For unit testing","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favidee007%2Fcustom-logger-advice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favidee007%2Fcustom-logger-advice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favidee007%2Fcustom-logger-advice/lists"}