Hi, R Vicky,
Maybe, put @Component to annotate KeyLogger class.
Also, make sure you have @ComponentScan in your "runner" class , the one with the main method.
@ComponentScan is to scan the packages and sub packages of the "runner" class.
Make sure your KeyLogger is in the same package as the runner class or in the subpackages.
The reason why I suggest this because there should be a KeyLogger bean in order to autowire it.
By annotating KeyLogger as @Component, the Spring container will create a bean out of KeyLogger class.