Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
38 views

Can we use AspectJ API to weave a .class file by a .aj file at runtime?

Basically, I want to create a .java file which can take as input the path to the .class file and name of methods to be logged. Using the aspectJ, we should save the weaved .class file having logs. Is ...
Shahnawaz Khan's user avatar
0 votes
2 answers
346 views

Spring Integration AOP for Logging outbound Http requests

I was looking at a post from 2014 about using Spring AOP for logging HTTP requests/replies: Spring integration + logging response time for http adapters(or any endpoint) To this end, I tried this AOP ...
al.truisme's user avatar
0 votes
1 answer
167 views

Is Spring AOP the easiest solution for crosscut logging of Http requests (inbound and outbound)? [closed]

I wanted to check to see if I hadn't missed another option for logging. I want to be able to add logging of HTTP input requests and HTTP output requests without having to add explicit logging ...
al.truisme's user avatar
0 votes
1 answer
266 views

How Blazor Server AOP logging?

I would like to implement and use an AOP logging in my Blazor Server .NET 5 (C# 9) application, for generic enter-exit-exception scenarios for the marked method(s). I know how to do it with ...
Tomcat's user avatar
  • 38
-1 votes
1 answer
152 views

Aspect printing null values for pointcut properties on AWS CloudWatch

These are AWS CloudWatch logs, in which I am getting null value (anyways getting the package, class, method name): 2021-05-10 04:27:36.707 INFO 1 --- [nio-8080-exec-3] t.o.platform.advice....
Shwet's user avatar
  • 1
1 vote
1 answer
3k views

How to ignore log property base on class type with Serilog

I'm implement AOP using Serilog to log all method call and parameters value Here is my code: _logger.ForContext(targetType).Information("INVOKE {@guid} {@MethodName} with parameters {@arg}", ...
phuongnd's user avatar
  • 1,289
0 votes
1 answer
1k views

Logging in each method vs Logging with Aspect? [duplicate]

Whenever I write an API or program with Spring Boot, my logging strategy is usually like below: @Service public class ShortLinkServiceImpl implements ShortLinkService { private final Logger ...
Aksoy's user avatar
  • 131
3 votes
4 answers
12k views

How to save requests and responses to database in spring boot

I would like to write an aspect or something like that and whenever a request comes to the controller it saves the request and the response to the database. First question is what type I should use in ...
Aksoy's user avatar
  • 131
5 votes
2 answers
10k views

Use AOP in a Spring Boot app to log methods calls and their parameters

Rather than manually writing code such as public void someMethod(Object someArg, Object otherArg) { logger.trace("someMethod invoked with arguments {}, {}", someArg, otherArg); /...
Antonio Dragos's user avatar
0 votes
0 answers
705 views

How to efficiently add method name to Java logging message without typing it in manually?

In my Java application, I would like the logs to reflect the calling method name in the message. So that a the following code: void foo(){ logger.info("some message"); } would result ...
Yossi Yaari's user avatar
1 vote
1 answer
1k views

Java Spring AOP:Making advice work for PostMappings that belong only to certain classes in a package

Hello i am trying to apply logging to my app by using aop.At this moment i can apply the advice on all the PostMapping methods from the application by using this pointcut. @Pointcut("@...
helloApp's user avatar
  • 459
1 vote
1 answer
166 views

Logging the AOP-way and custom messages

I am trying to implement logging capabilites into my application using Autofac's IInterceptor interface provided by Autofac.Extras.DynamicProxy. This is what I got so far. A service which actions ...
Matthias Güntert's user avatar
1 vote
2 answers
2k views

Logger clean up Using Spring AOP

We're trying to introduce generic logger in our application using Spring AOP for log statements which are under catch block. Before AOP try { \\Business Logic } catch(Exception e){ \\some recovery ...
Sagar Kadu's user avatar
1 vote
0 answers
451 views

How to replace spring.xml configuration with Java configuration?

I'm working with a Spring AOP tutorial designed to intercept and time method calls. It's using an XML configuration but my company framework utilizes a Java Configuration. Im new to Spring and could ...
mangel's user avatar
  • 65
2 votes
1 answer
2k views

Spring AOP logger trace ID with Spring Cloud Sleuth?

I have a few microservices running with Spring Cloud Sleuth as a distributed logging manager. For some microservices Spring AOP is also included, mostly with @Around advice for methods execution time ...
hideburn's user avatar
  • 436
0 votes
1 answer
349 views

Invoke of a method - logging as method declaring class

I'm currently using JBoss interceptors and Proxy classes for wrapping method invoking at runtime and log some statistics. So said, having this code: public class ProxyLoggingInterceptor <T> ...
Fabrizio Stellato's user avatar
10 votes
2 answers
16k views

Logging using AOP in .NET Core 2.1

I want to implement AOP for the logging in my .NET Core 2.1 solution. I've never used it before and I've been looking online and cant seem to see any examples of people using it with Core 2. Does ...
user2661305's user avatar
1 vote
0 answers
61 views

(Android) Global Interceptor for Android methods and classes?

I need to implement extra log (anayltics) for all methods in my classes. So i need to add some global that executed before and after the method is called. Also i need to get that method & class ...
Sky Blue's user avatar
  • 213
3 votes
1 answer
4k views

Placing log information inside a method: Using AspectJ , Spring

I am new to AOP and I came to know that it helps in separating crosscutting concerns, and seems to be a good feature which adds charm to OOPs programming. As always, the classical example which I ...
CuriousMind's user avatar
  • 8,871
0 votes
0 answers
124 views

How to decouple your code when recording logs

I want to keep the audit logs for my service which can add/update/delete user and relevant roles. But I find the audit logs couple to the service code tightly. Actually I think the developer should ...
GsM's user avatar
  • 161
1 vote
1 answer
3k views

Springboot Event Logging

I have a scheduled task in a fixed rate, that reads a queue. Each message that comes from the queue has an ID. I wanna know if it's possible split the log by ID, appending to a different file. I was ...
DTodt's user avatar
  • 380
0 votes
1 answer
354 views

AOP - accessing a protected/private attribute from the intercepted class

I am working on a project that is basically a lot of processes that run periodically. Each process is a different class that extends an abstract class RunnableProcess we created, which contains a ...
Leonardo Alves Machado's user avatar
2 votes
1 answer
3k views

Get class name and method parameters in the aspect

I am working on a project that is basically a lot of processes that run periodically. Each process is a different class that extends an abstract class RunnableProcess we created, which contains the ...
Leonardo Alves Machado's user avatar
0 votes
1 answer
699 views

Spring AOP logging

I have a j2ee web application running on Spring framework. I want to implement logging using log4j and Spring's AOP. I am able to log the public methods using custom annotation. I am not able to log ...
bookofcodes's user avatar
2 votes
0 answers
969 views

AOP logging and database queries

I'm trying to log parameters in a query to the database by making use of AspectJ. The way I'm trying to do this is by jumping in during the calls to java.sql.CallableStatement, specifically the ...
TheLimeTrees's user avatar
2 votes
1 answer
448 views

How to enable PostSharp for all methods called within a specific method?

I've recently started using PostSharp for one of our project. The aim is to log method execution time for all the methods being called within a specific method (representing an specific feature). ...
Rohit Singh's user avatar
  • 2,251
0 votes
1 answer
97 views

How to print access log without spring?

What I really want is AOP, which is supported in spring. But sadly my leader didn't allow us to use spring. We write a service layer with java, thrift and jdbc. I used to use spring's aspect to print ...
blackdog's user avatar
  • 2,087
0 votes
1 answer
62 views

Extend class functions with repeatable common code

I use Dapper to access my data, as per code below. There are only two functions but real code can have hundreads. I would like to log in a specific database table all executed SQL statements. This ...
Megrez7's user avatar
  • 1,447
2 votes
0 answers
205 views

Ninject intercept all virtual methods by default

I'm trying to add logging in to application. Based on this blog post Logging with Ninject It blog solves almost all my problems and even more. However there is one small issue that I cannot solve. ...
Icen's user avatar
  • 451
2 votes
1 answer
5k views

AOP based logging in Guice

I am trying to implement AOP based logging in Google - Guice. I have used MethodInterceptor for this but it doesn't work. I have used same in Spring by defining point-cuts. Everything is working fine ...
Ankur Mahajan's user avatar
0 votes
1 answer
151 views

How do I use PostSharp to do call stack aggregated logging?

I'm currently using PostSharp to do AOP performance logging, and I'd like to do some aggregated variants on ProfilerAspects. One variant I'm interested in is aggregating the logging by the first ...
Stephen_D_Lewis's user avatar
1 vote
1 answer
179 views

Spring AOP Usage

I am thinking of moving all my Slf4j logging to replace with Spring AOP. But now I have some questions on how to use Spring AOP in the following scenarios. I could see that we can use it to print ...
Santosh's user avatar
  • 1,929
0 votes
0 answers
242 views

AOP logging of stored proc calls

I have inherited large complex Web App which includes Flex/Robotlegs, BlazeDS and Spring3. It makes many calls to DB Stored Procs (SQL Server) using Spring's JdbcTemplate and SimpleJdbcCall - like: ...
olegkon's user avatar
  • 65
0 votes
1 answer
130 views

logging with PostSharp multicastAttribute

I'm trying to implement logging with PostSharp and multicastAttribute. Using the Logging aspect that comes in PostSharp Diagnostics library. I have a GlboalAspects.cs in the start up project ...
t.durden's user avatar
  • 178
1 vote
2 answers
781 views

log or Audit in spring and database for 2 purposes how much time a method, task and job took and also store caclulations for audit debug purpose

Our application uses java / sql server. We have ETL jobs (around 35 for different upstreams) using sprint batch. Some of the code is in java and some in database. We want to track lifecycle of a job ...
Naren's user avatar
  • 86
3 votes
1 answer
10k views

AOP without Spring

I implemented Logger using Spring 4.0 and AspectJ. But I'm now trying to make the logger independent of Spring. I couldn't initialize aspect in my application. Any hint to start will be helpful. ...
Surendar Vinayagamoorthy's user avatar
0 votes
1 answer
836 views

Marshalling data back to UI Thread from within Async Action

I've got an ICommand that needs to set data to a property on the UI Thread. public override async void Execute(object parameter) { var vm = (MyVm)parameter; var data = await _myDataService....
Chase Florell's user avatar
2 votes
1 answer
3k views

Logging entry, exit and exceptions for methods in java using aspects

I am using the below code to log entry, exit and exceptions using aspects. This way I have to define a bean for every class in my application in my ApplicationContext and it becomes cumbersome to ...
Atom's user avatar
  • 788
16 votes
1 answer
15k views

Spring Boot Logger Aspects

I'm having problems getting my logging aspect to log information when methods from classes of a particular package are accessed. In other words, "no" logging occurs. I even got desperate and added ...
Rick's user avatar
  • 709
1 vote
1 answer
2k views

Intercept Exceptions for logging with CDI's AOP on Java EE 7

I have the following class snippet, from which I'd like to remove the repetitive logging code and move it to an Interceptor using CDI's AOP. /** * Javadoc omitted */ public abstract class JpaDao<...
Bruno Gasparotto's user avatar
1 vote
1 answer
2k views

Spring Aop logging line number incorrect

I am using spring aop to do logging for my application : I have before after and afterthrowing advice configured but the line numbers that I see is not of the target class but that of the class used ...
nirav's user avatar
  • 77
7 votes
2 answers
17k views

How do you get RequestMapping request in AOP advice from a Spring controller?

Given some kind of controller with a request mapping @RequestMapping(value="/some/path", method=RequestMethod.POST) How would you retrieve the method value (RequestMethod.POST) in the aspect class? ...
Andy Leung's user avatar
1 vote
1 answer
1k views

C# logging "russian dolls effect" in constructors parameters

First, I am not sure that I use the good words to describe my problem, apologies (English is not my mother tong). It is about adding loggers to a project. As it was asked, there should be several ...
Sylvain B.'s user avatar
0 votes
1 answer
625 views

Get Values Of Method On Throws Exceptions in C#

I work on a logging project. I want to save parameter values of methods in database. How can I get these values. I want to get parameter value of "Test" method in FirstChanceException event. class ...
ArMaN's user avatar
  • 2,397
1 vote
3 answers
2k views

Castle Windsor enable or disable interceptors during run time

Is it possible whilst an application (of any type e.g. console, web, web role in azure etc.) to switch castle windsor interceptors on or off to avoid an application restart? My scenario is to use an ...
Danjuro's user avatar
  • 215
0 votes
1 answer
53 views

How to wrap method invokation inside bundle?

I have cq5 application. we have a following class hierarchy (pseudocode): class serviceA{ methodA1(){...} methodA2(){...} methodA3(){ ... httprequest ... } methodA4()...
gstackoverflow's user avatar
0 votes
1 answer
383 views

AOP Logging with custom arguments

Before every method executes, I want to log all parameters from that method. For that, I would use AOP (Aspect oriented programming) and create a "Loggable" attribute. But... I also would like to know ...
RubenHerman's user avatar
  • 1,824
0 votes
2 answers
2k views

Logging local variable values with AspectJ

I heard a lot of great things about how AOP could help modularize things like logging, but now as I am trying to implement this, I am finding AspectJ is very limited. Not only is it sometimes ...
Kat's user avatar
  • 4,695
0 votes
1 answer
72 views

When logging with AOP, should we keep all logging in one class or divide amongst many?

I'm trying to introduce AOP into a project in the form of logging. One thing I haven't found an answer for yet is how to handle very large aspects. It seems intuitive that logging would be a single ...
Kat's user avatar
  • 4,695
1 vote
1 answer
771 views

404 Error on using Spring AOP Logging

I was trying to add AOP logger to the existing Spring(v3.1.3) application. Below is the code for the same. Application launches successfully and am able to login. But, once the flow reaches the ...
Prince's user avatar
  • 41