3
when it is in production I want that when it falls into an exception send an email to the support but only in production , in development I do not want it to perform this task .
3
when it is in production I want that when it falls into an exception send an email to the support but only in production , in development I do not want it to perform this task .
4
The solution was to inject a spring boot class called Environment .
@Autowired
private Environment environment;
environment.getActiveProfiles()[0].equals("production"));
Application file.properties
#ENVIRONMENT
spring.profiles.active=develop
Browser other questions tagged java spring spring-mvc spring-security spring-boot
You are not signed in. Login or sign up in order to post.
You can create a property in a configuration file and make the code look at this property to know what environment it is running in.
– Caffé
I found the problem solving prop spring-boot has a native class called Environment so inject it :)
– Jose Vieira Neto