0
私はSpringデータリポジトリを持っています。 http://localhost:8080/persons webserviceが呼び出されたときに、何かを記録したい。私はMyCustomRepository <>を作りたくありません。クリーナーオプション?カスタムリポジトリを使用せずに、いくつかのログを「前」に印刷する方法
レポクラス:
@RepositoryRestResource(collectionResourceRel = "persons", path = "persons")
public interface PersonRepository extends PagingAndSortingRepository<Person, Long> {
List<Person> findByLastName(@Param("name") String name);
サンプルログ:
log.error("AccessToken: " + securityContext.getTokenString());
log.error("User: {}/{}", accessToken.getPreferredUsername(), accessToken.getName());
log.error("Principal: {}", principal.getName());
ありがとうございます。それがこのクロスカットの側面にとって最もクリーンな方法です。私は2つの異なるポイントカット()をoneAdvice()[1つは.wsパッケージから、もう1つは.restパッケージから]に送りこうとしていました。それを行う方法をチェックします。 – Espresso