Set a large dutch oven over medium heat, and put in olive oil, sliced onions, grated apple, rosemary and/or thyme, salt and pepper, and give a good stir until everything is coated in oil. Let the mixture slowly warm and cook a few minutes until you can hear the onions hissing and they start to get translucent. Throw in the wine and bay leaf and cover. Let it cook over medium-low heat for 20 minutes, lifting the lid to stir about every 10 minutes. You want the onions to soften and become golden, but not take on an ounce of brown yet.
Lift the lid and fish out the bay leaf to discard. Turn the heat to low, and add ¼ cup of water and the sugar. Stir and let the mixture start to slowly, and I mean slowly, take on color. You’re trying to coax new flavors out of this humble onion, so don’t rush it. You’ll need to stir the jam every 10-15 minutes to make sure it’s not getting too brown in any once place. If it gets too sticky (and it will!), but not yet brown enough, add a quarter cup of water and stir. You might have to do that a few times. At the end of an hour, it should be thick and deeply amber and fragrant. Add the white wine vinegar and a dab of butter and stir well. Taste one last time to check seasonings.
Serve atop little toasts with fresh ricotta or have alongside your morning bread. It even pairs nicely with a thick slab of juicy steak.
Makes about 2 cups and will keep for a month sealed tightly in the fridge. Or if you’re inclined to such things, quadruple this recipe and can for a shelf-stable treat.