Getting divorced is very personal. You may not feel all that comfortable discussing it with your boss. Do you need to do it?
While it may not be necessary in some situations, and you certainly do not have to go into detail, most experts agree that you will probably have to tell your boss the basic facts: that you are splitting up and when it's happening.
After all, it could have a very real impact on your availability. If you wind up in court during work hours, you have to take time off. If you need to watch your children due to a new custody plan, you may need a new schedule at work.
Your boss hopefully cares about company morale, as well. They want employees to feel happy and motivated. If this is going to impact the way you feel and potentially your productivity, it may be wise to keep your boss in the loop.
Finally, there are some realistic financial concerns. Even before you officially split up, you may need to speak to payroll to get your paychecks sent to a personal bank account, rather than the joint account you and your spouse use. If you get a pension, your ex may be entitled to a portion of it after the divorce, so you need to know how that is going to impact the plan.
All told, it is best to be open about this and keep everyone informed. That helps a difficult process go smoothly. At the same time, make sure you look into all of your legal rights.