Many people modify the setDomainEnv.sh file that specifies the core settings for a WebLogic domain, e.g. for adding debug or monitoring ports or additional switches for the JVM:
I confess, I do the same for quick and dirty hacks, yet changes here will be overwritten during a domain upgrade. It’s much better to put such changes into the following config file:
Your changes will remain even when updating a domain, also they will be respected by pack/unpack. Check out the official Oracle documentation.