In a large rondeaux or pot on medium heat with butter, add in the onions and slowly caramelize them while stirring occasionally. This can take up to 60 minutes.
After 30 minutes of the onions cooking, add in the sugar to help brown and add some sweetness.
After the onions are browned and translucent, add in the red wine and cook until it has been absorbed by the onions. Next, add in the stock, bay leaves, salt and pepper, and simmer for 1 hour.
Finish the soup with the fresh thyme.
Spread out the sliced French bread on a sheet pan lined with parchment paper and brush on a small amount of melted butter on each piece. Season with salt and pepper and bake in the oven on 350° for 15 minutes or until lightly browned and crispy to make a crostini.
Pour some soup into a bowl or crock and top off with a few crostinis and top off with 1/2 to 1 cup of shredded Gruyere cheese. Place the soup bowl in the broiler on low heat until the cheese is melted and lightly browned.